From fdb78fa144b70d15b2d12b4aaeb19e27088b70a0 Mon Sep 17 00:00:00 2001 From: Jasha10 <8935917+Jasha10@users.noreply.github.com> Date: Tue, 19 Oct 2021 15:12:09 -0500 Subject: [PATCH] Compatibility with pip version 21.3.0 (#800) --- .flake8 | 2 +- build_helpers/build_helpers.py | 1 - noxfile.py | 18 +++++++++--------- pyproject.toml | 3 ++- setup.py | 2 -- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.flake8 b/.flake8 index e6d773080..7a36d6a4e 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] -exclude = .git,.nox,.tox,omegaconf/grammar/gen +exclude = .git,.nox,.tox,omegaconf/grammar/gen,build max-line-length = 119 select = E,F,W,C ignore=W503,E203 diff --git a/build_helpers/build_helpers.py b/build_helpers/build_helpers.py index 2c2b79471..0bcfd3e66 100644 --- a/build_helpers/build_helpers.py +++ b/build_helpers/build_helpers.py @@ -79,7 +79,6 @@ def run(self) -> None: "^omegaconf\\.egg-info$", "\\.eggs$", "^\\.mypy_cache$", - "^\\.nox$", "^\\.pytest_cache$", ".*/__pycache__$", "^__pycache__$", diff --git a/noxfile.py b/noxfile.py index 484c1c466..b8e9be969 100644 --- a/noxfile.py +++ b/noxfile.py @@ -10,27 +10,27 @@ ).split(",") -def deps(session, editable_installl): +def deps(session, editable_install): session.install("--upgrade", "setuptools", "pip") - extra_flags = ["-e"] if editable_installl else [] + extra_flags = ["-e"] if editable_install else [] session.install("-r", "requirements/dev.txt", *extra_flags, ".", silent=True) @nox.session(python=PYTHON_VERSIONS) def omegaconf(session): - deps(session, editable_installl=False) # ensure we test the regular install + deps(session, editable_install=False) # ensure we test the regular install session.run("pytest") @nox.session(python=PYTHON_VERSIONS) def benchmark(session): - deps(session, editable_installl=True) + deps(session, editable_install=True) session.run("pytest", "benchmark/benchmark.py") @nox.session def docs(session): - deps(session, editable_installl=True) + deps(session, editable_install=True) session.chdir("docs") session.run("sphinx-build", "-W", "-b", "doctest", "source", "build") session.run("sphinx-build", "-W", "-b", "html", "source", "build") @@ -41,9 +41,9 @@ def coverage(session): # For coverage, we must use the editable installation because # `coverage run -m pytest` prepends `sys.path` with "." (the current # folder), so that the local code will be used in tests even if we set - # `editable_installl=False`. This would cause problems due to potentially + # `editable_install=False`. This would cause problems due to potentially # missing the generated grammar files. - deps(session, editable_installl=True) + deps(session, editable_install=True) session.run("coverage", "erase") session.run("coverage", "run", "--append", "-m", "pytest", silent=True) session.run("coverage", "report", "--fail-under=100") @@ -55,7 +55,7 @@ def coverage(session): @nox.session(python=PYTHON_VERSIONS) def lint(session): - deps(session, editable_installl=True) + deps(session, editable_install=True) session.run("mypy", ".", "--strict", silent=True) session.run("isort", ".", "--check", silent=True) session.run("black", "--check", ".", silent=True) @@ -70,6 +70,6 @@ def test_jupyter_notebook(session): session.python, ",".join(DEFAULT_PYTHON_VERSIONS) ) ) - deps(session, editable_installl=False) + deps(session, editable_install=False) session.install("jupyter", "nbval") session.run("pytest", "--nbval", "docs/notebook/Tutorial.ipynb", silent=True) diff --git a/pyproject.toml b/pyproject.toml index 6de77c1b0..87ef5cf1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,8 +5,9 @@ exclude = ''' \.eggs # exclude a few common directories in the | \.git # root of the project | \.mypy_cache - | \omegaconf/grammar/gen + | omegaconf/grammar/gen | \.nox + | build ) ) ''' diff --git a/setup.py b/setup.py index fdef9e20e..d1d59c755 100644 --- a/setup.py +++ b/setup.py @@ -46,8 +46,6 @@ description="A flexible configuration library", long_description=LONG_DESC, long_description_content_type="text/markdown", - setup_requires=["pytest-runner"], - tests_require=["pytest"], url="https://github.com/omry/omegaconf", keywords="yaml configuration config", packages=[