Skip to content

Commit

Permalink
Compatibility with pip version 21.3.0 (omry#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasha10 authored Oct 19, 2021
1 parent 32e82d3 commit fdb78fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion build_helpers/build_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def run(self) -> None:
"^omegaconf\\.egg-info$",
"\\.eggs$",
"^\\.mypy_cache$",
"^\\.nox$",
"^\\.pytest_cache$",
".*/__pycache__$",
"^__pycache__$",
Expand Down
18 changes: 9 additions & 9 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -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)
Expand All @@ -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)
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)
'''
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down

0 comments on commit fdb78fa

Please sign in to comment.