Skip to content

Commit

Permalink
CI requirements drop pip packages (#3939)
Browse files Browse the repository at this point in the history
* requirements pip to conda

* use pip install over develop

* default PY_VER to python versions
  • Loading branch information
bjlittle authored Dec 23, 2020
1 parent 723a2f4 commit 6e6fe03
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
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")
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

0 comments on commit 6e6fe03

Please sign in to comment.