Skip to content

Commit

Permalink
CHANGE: move to uv for CI / environments (#80)
Browse files Browse the repository at this point in the history
* first step at moving to uv

* move to uv for CI, no need for environment.yml

* debugging github actions

* use uv to build for docs

* let it go

* use their recommendation

* remove yaml file we no longer need
  • Loading branch information
nocollier authored Dec 17, 2024
1 parent 4924bfd commit 22e9aea
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 95 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,19 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
fetch-depth: 0

- name: Create conda environment
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
environment-file: ci/environment.yml
environment-name: intake-esgf-dev
create-args: >-
python=${{ matrix.python-version }}
- name: Install uv environment
uses: astral-sh/setup-uv@v4

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install intake-esgf
run: |
python -m pip install -e . --no-deps --force-reinstall
- name: Install intake-esgf and dependencies
run: uv sync

- name: Run Tests
run: |
python -m pytest
run: uv run pytest

- name: Upload code coverage to Codecov
uses: codecov/[email protected]
Expand Down
13 changes: 9 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
version: 2
conda:
environment: ci/environment-docs.yml

build:
os: "ubuntu-20.04"
os: "ubuntu-24.04"
tools:
python: "mambaforge-4.10"
python: "3.12"
commands:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv sync --extra docs
- uv run -m sphinx -T -b html -d doc/_build/doctrees -D language=en doc $READTHEDOCS_OUTPUT/html
20 changes: 0 additions & 20 deletions ci/environment-docs.yml

This file was deleted.

19 changes: 0 additions & 19 deletions ci/environment.yml

This file was deleted.

58 changes: 54 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,54 @@
# https://snarky.ca/what-the-heck-is-pyproject-toml/
[project]
name = "intake-esgf"
description = "Programmatic access to the ESGF holdings"
readme = "README.md"
authors = [
{ name = "Nathan Collier", email = "[email protected]" }
]
classifiers = ["Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering"]
license = { file="LICENSE" }
requires-python = ">=3.10"
dependencies = [
"dask",
"globus-sdk",
"netcdf4",
"pandas",
"pyyaml",
"requests",
"tqdm",
"xarray",
]
dynamic=["version"]

[dependency-groups]
dev = [
"pytest-cov",
]

[project.optional-dependencies]
docs = [
"distributed",
"furo",
"ipywidgets",
"matplotlib",
"myst-nb",
"nc-time-axis",
"numpydoc",
"sphinx-autosummary-accessors",
"sphinx-copybutton",
]
notebook = [
"ipywidgets",
"tqdm[notebook]",
]

[build-system]
requires = ["setuptools", "setuptools_scm", "wheel"]
Expand All @@ -8,8 +58,8 @@ build-backend = "setuptools.build_meta"
version_scheme = "no-guess-dev"
local_scheme = "node-and-date"
fallback_version = "0.0.0"
write_to = "intake_esgf/_version.py"
write_to_template = '__version__ = "{version}"'
version_file = "intake_esgf/_version.py"
version_file_template = '__version__ = "{version}"'

[tool.pytest.ini_options]
console_output_style = "count"
Expand All @@ -24,7 +74,7 @@ omit = ["*/intake_esgf/tests/*"]
[tool.ruff]
target-version = "py310"
ignore = [
"E501", # line too long - let black worry about that
"E501", # let black worry about line length
]
select = [
"F", # Pyflakes
Expand Down
34 changes: 0 additions & 34 deletions setup.cfg

This file was deleted.

0 comments on commit 22e9aea

Please sign in to comment.