Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI requirements drop pip packages #3939

Merged
merged 3 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 15 additions & 15 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
PACKAGE = str("lib" / Path("iris"))

#: Cirrus-CI environment variable hook.
PY_VER = os.environ.get("PY_VER", "3.7")
PY_VER = os.environ.get("PY_VER", ["3.6", "3.7"])

#: Default cartopy cache directory.
CARTOPY_CACHE_DIR = os.environ.get("HOME") / Path(".local/share/cartopy")
Expand All @@ -41,7 +41,7 @@ def venv_cached(session):

"""
result = False
yml = Path(f"requirements/ci/py{PY_VER.replace('.', '')}.yml")
yml = Path(f"requirements/ci/py{session.python.replace('.', '')}.yml")
tkknight marked this conversation as resolved.
Show resolved Hide resolved
tmp_dir = Path(session.create_tmp())
cache = tmp_dir / yml.name
if cache.is_file():
Expand All @@ -66,7 +66,7 @@ def cache_venv(session):
A `nox.sessions.Session` object.

"""
yml = Path(f"requirements/ci/py{PY_VER.replace('.', '')}.yml")
yml = Path(f"requirements/ci/py{session.python.replace('.', '')}.yml")
with open(yml, "rb") as fi:
hexdigest = hashlib.sha256(fi.read()).hexdigest()
tmp_dir = Path(session.create_tmp())
Expand Down Expand Up @@ -131,7 +131,7 @@ def black(session):
session.run("black", "--check", __file__)


@nox.session(python=[PY_VER], venv_backend="conda")
@nox.session(python=PY_VER, venv_backend="conda")
def tests(session):
"""
Perform iris system, integration and unit tests.
Expand All @@ -150,7 +150,7 @@ def tests(session):
"""
if not venv_cached(session):
# Determine the conda requirements yaml file.
fname = f"requirements/ci/py{PY_VER.replace('.', '')}.yml"
fname = f"requirements/ci/py{session.python.replace('.', '')}.yml"
# Back-door approach to force nox to use "conda env update".
command = (
"conda",
Expand All @@ -164,7 +164,7 @@ def tests(session):
cache_venv(session)

cache_cartopy(session)
session.run("python", "setup.py", "develop")
session.install("--no-deps", "--editable", ".")
session.run(
"python",
"-m",
Expand All @@ -174,7 +174,7 @@ def tests(session):
)


@nox.session(python=[PY_VER], venv_backend="conda")
@nox.session(python=PY_VER, venv_backend="conda")
def gallery(session):
"""
Perform iris gallery doc-tests.
Expand All @@ -193,7 +193,7 @@ def gallery(session):
"""
if not venv_cached(session):
# Determine the conda requirements yaml file.
fname = f"requirements/ci/py{PY_VER.replace('.', '')}.yml"
fname = f"requirements/ci/py{session.python.replace('.', '')}.yml"
# Back-door approach to force nox to use "conda env update".
command = (
"conda",
Expand All @@ -207,7 +207,7 @@ def gallery(session):
cache_venv(session)

cache_cartopy(session)
session.run("python", "setup.py", "develop")
session.install("--no-deps", "--editable", ".")
session.run(
"python",
"-m",
Expand All @@ -216,7 +216,7 @@ def gallery(session):
)


@nox.session(python=[PY_VER], venv_backend="conda")
@nox.session(python=PY_VER, venv_backend="conda")
def doctest(session):
"""
Perform iris doc-tests.
Expand All @@ -235,7 +235,7 @@ def doctest(session):
"""
if not venv_cached(session):
# Determine the conda requirements yaml file.
fname = f"requirements/ci/py{PY_VER.replace('.', '')}.yml"
fname = f"requirements/ci/py{session.python.replace('.', '')}.yml"
# Back-door approach to force nox to use "conda env update".
command = (
"conda",
Expand All @@ -249,7 +249,7 @@ def doctest(session):
cache_venv(session)

cache_cartopy(session)
session.run("python", "setup.py", "develop")
session.install("--no-deps", "--editable", ".")
session.cd("docs/iris")
session.run(
"make",
Expand All @@ -264,7 +264,7 @@ def doctest(session):
)


@nox.session(python=[PY_VER], venv_backend="conda")
@nox.session(python=PY_VER, venv_backend="conda")
def linkcheck(session):
"""
Perform iris doc link check.
Expand All @@ -283,7 +283,7 @@ def linkcheck(session):
"""
if not venv_cached(session):
# Determine the conda requirements yaml file.
fname = f"requirements/ci/py{PY_VER.replace('.', '')}.yml"
fname = f"requirements/ci/py{session.python.replace('.', '')}.yml"
# Back-door approach to force nox to use "conda env update".
command = (
"conda",
Expand All @@ -297,7 +297,7 @@ def linkcheck(session):
cache_venv(session)

cache_cartopy(session)
session.run("python", "setup.py", "develop")
session.install("--no-deps", "--editable", ".")
session.cd("docs/iris")
session.run(
"make",
Expand Down
7 changes: 2 additions & 5 deletions requirements/ci/py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ dependencies:

# Documentation dependencies.
- sphinx
- sphinxcontrib-napoleon
- sphinx-copybutton
- sphinx-gallery
- sphinx-panels
- sphinx_rtd_theme
- pip
- pip:
- sphinxcontrib-napoleon
- sphinx-panels

6 changes: 2 additions & 4 deletions requirements/ci/py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ dependencies:

# Documentation dependencies.
- sphinx
- sphinxcontrib-napoleon
- sphinx-copybutton
- sphinx-gallery
- sphinx-panels
- sphinx_rtd_theme
- pip
- pip:
- sphinxcontrib-napoleon
- sphinx-panels