Skip to content

Commit

Permalink
Update CI workflows to use micromamba for Conda environment setup and…
Browse files Browse the repository at this point in the history
… reorganize pyproject.toml
  • Loading branch information
andersy005 committed Jan 16, 2025
1 parent 6bbf136 commit 37d4bd1
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 121 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ jobs:
sudo apt-get update
sudo apt-get install zsh tcsh
cat /etc/shells
- uses: conda-incubator/setup-miniconda@master
- name: Install Conda environment from environment.yml
uses: mamba-org/setup-micromamba@v2
id: conda
with:
channels: conda-forge
channel-priority: strict
activate-environment: jupyter-forward-dev
auto-update-conda: false
python-version: ${{ matrix.python-version }}
mamba-version: "*"
use-mamba: true
miniforge-variant: Mambaforge
# environment-file is not assumed anymore
environment-file: ci/environment.yml
create-args: >-
python=${{ matrix.python-version }}
# now called cache-environment
cache-environment: true

- name: Install jupyter-forward
run: |
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,17 @@ jobs:
sudo apt-get update
sudo apt-get install zsh tcsh
cat /etc/shells
- uses: conda-incubator/setup-miniconda@v3
- name: Install Conda environment from environment.yml
uses: mamba-org/setup-micromamba@v2
id: conda
with:
channels: conda-forge,nodefaults
channel-priority: strict
activate-environment: jupyter-forward-dev
auto-update-conda: false
python-version: ${{ matrix.python-version }}
# environment-file is not assumed anymore
environment-file: ci/environment-upstream-dev.yml
mamba-version: "*"
use-mamba: true
miniforge-variant: Mambaforge
create-args: >-
python=${{ matrix.python-version }}
# now called cache-environment
cache-environment: true

- name: Install jupyter-forward
id: install
Expand Down
198 changes: 95 additions & 103 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,132 +1,124 @@
[build-system]
requires = ["setuptools>=64", "setuptools-scm[toml]>=6.2", "wheel"]
build-backend = "setuptools.build_meta"

build-backend = "setuptools.build_meta"
requires = ["setuptools-scm[toml]>=6.2", "setuptools>=64", "wheel"]

[project]
name = "jupyter-forward"
description = "Jupyter Lab Port Forwarding Utility"
readme = "README.md"
license = {text="Apache Software License 2.0"}
requires-python = ">=3.10"
maintainers = [{ name = "Xdev", email = "xdev@ucar.edu" }]
keywords = ["jupyter-forward"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]




dynamic = ["version", "dependencies"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]
description = "Jupyter Lab Port Forwarding Utility"
keywords = ["jupyter-forward"]
license = { text = "Apache Software License 2.0" }
maintainers = [{ name = "Xdev", email = "xdev@ucar.edu" }]
name = "jupyter-forward"
readme = "README.md"
requires-python = ">=3.10"

dynamic = ["dependencies", "version"]

[tool.setuptools.dynamic]

dependencies = { file = ["requirements.txt"] }
optional-dependencies = { dev = { file = ["requirements-dev.txt"] } }
dependencies = { file = ["requirements.txt"] }
optional-dependencies = { dev = { file = ["requirements-dev.txt"] } }

[project.scripts]
jlab-forward = "jupyter_forward.cli:main"
jupyter-forward = "jupyter_forward.cli:main"
jlab-forward = "jupyter_forward.cli:main"
jupyter-forward = "jupyter_forward.cli:main"

[project.urls]
Documentation = "https://github.com/ncar-xdev/jupyter-forward"
Homepage = "https://github.com/ncar-xdev/jupyter-forward"
Source = "https://github.com/ncar-xdev/jupyter-forward"
Tracker = "https://github.com/ncar-xdev/jupyter-forward/issues"
Documentation = "https://github.com/ncar-xdev/jupyter-forward"
Homepage = "https://github.com/ncar-xdev/jupyter-forward"
Source = "https://github.com/ncar-xdev/jupyter-forward"
Tracker = "https://github.com/ncar-xdev/jupyter-forward/issues"

[tool.setuptools.packages.find]
include = ["jupyter_forward*"]
include = ["jupyter_forward*"]

[tool.setuptools.package-data]
offsets_db_data = ["py.typed"]


offsets_db_data = ["py.typed"]

[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "node-and-date"
fallback_version = "999"
write_to = "jupyter_forward/_version.py"
write_to_template = '__version__ = "{version}"'

fallback_version = "999"
local_scheme = "node-and-date"
version_scheme = "post-release"
write_to = "jupyter_forward/_version.py"
write_to_template = '__version__ = "{version}"'

[tool.ruff]
line-length = 100
target-version = "py310"

builtins = ["ellipsis"]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
line-length = 100
target-version = "py310"

builtins = ["ellipsis"]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
[tool.ruff.lint]
per-file-ignores = {}
ignore = [
"E721", # Comparing types instead of isinstance
"E741", # Ambiguous variable names
"E501", # Conflicts with ruff format
]
select = [
# Pyflakes
"F",
# Pycodestyle
"E",
"W",
# isort
"I",
# Pyupgrade
"UP",
]
ignore = [
"E501", # Conflicts with ruff format
"E721", # Comparing types instead of isinstance
"E741", # Ambiguous variable names
]
per-file-ignores = {}
select = [
# Pyflakes
"F",
# Pycodestyle
"E",
"W",
# isort
"I",
# Pyupgrade
"UP",
]

[tool.ruff.lint.mccabe]
max-complexity = 18
max-complexity = 18

[tool.ruff.lint.isort]
known-first-party = ["jupyter_forward"]
known-first-party = ["jupyter_forward"]

[tool.ruff.format]
quote-style = "single"
docstring-code-format = true
docstring-code-format = true
quote-style = "single"

[tool.ruff.lint.pydocstyle]
convention = "numpy"

convention = "numpy"

[tool.pytest.ini_options]
console_output_style = "count"
addopts = "--cov=./ --cov-report=xml --verbose"
addopts = "--cov=./ --cov-report=xml --verbose"
console_output_style = "count"

0 comments on commit 37d4bd1

Please sign in to comment.