Skip to content

Commit

Permalink
Migrate to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Sep 11, 2024
1 parent 2d3f0ce commit 64204c0
Show file tree
Hide file tree
Showing 5 changed files with 2,411 additions and 65 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:

jobs:
lint:
name: Lint

runs-on: ubuntu-latest

steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ on:
name: Create Release

jobs:
build:
name: Build wheels
release:
name: Build and publish

runs-on: ubuntu-latest

strategy:
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
- 'docs/**'

jobs:
build:
test:
name: Test

runs-on: ubuntu-latest

strategy:
Expand All @@ -24,17 +26,20 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true

- name: Install dependencies
run: |
pip install --upgrade wheel pip setuptools
pip install -e .
uv sync --no-dev
- name: Test with pytest
run: |
pip install pytest pytest-mock pytest-asyncio pytest-cov coverage[toml]
pytest
uv pip install pytest pytest-mock pytest-asyncio pytest-cov
uv run pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
108 changes: 51 additions & 57 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,66 +1,56 @@
[tool.poetry]
[project]
name = "lvmopstools"
version = "0.2.1a0"
description = "LVM tools and utilities for operations"
authors = ["José Sánchez-Gallego <[email protected]>"]
license = "BSD-3-Clause"
readme = "README.md"
homepage = "https://github.com/sdss/lvmopstools"
repository = "https://github.com/sdss/lvmopstools"
documentation = "https://lvmopstools.readthedocs.org"
keywords = ["astronomy", "software"]
classifiers = [
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Documentation :: Sphinx",
"Topic :: Software Development :: Libraries :: Python Modules"
]
packages = [
{ include = "lvmopstools", from = "src" }
authors = [
{ name = "José Sánchez-Gallego", email = "[email protected]" }
]
license = { text = "BSD-3-Clause" }
readme = "README.md"
requires-python = ">=3.10,<4"

[tool.poetry.scripts]
lvmtools = 'lvmopstools.__main__:lvmopstools'
dependencies = [
"sdsstools>=1.6.1",
"sdss-clu>=2.2.7",
"astropy>=6.1"
]

[tool.poetry.dependencies]
python = "^3.10"
sdsstools = "^1.3.1"
sdss-clu = "^2.2.3"
astropy = "^6.0.0"
click = "^8.1.7"
pyds9 = {version = "^1.8.1", optional = true}
[project.optional-dependencies]
ds9 = [ "pyds9>=1.8.1" ]

[tool.poetry.group.dev.dependencies]
ipython = ">=8.0.0"
pytest = ">=5.2.2"
pytest-asyncio = ">=0.10.0"
pytest-cov = ">=2.8.1"
pytest-mock = ">=1.13.0"
pytest-sugar = ">=0.9.2"
coverage = {version = ">=5.0", extras = ["toml"]}
ipdb = ">=0.12.3"
rstcheck = ">=3.3.1"
Sphinx = ">=4.0.0"
furo = ">=2021.9.22"
sphinx-copybutton = ">=0.4.0"
sphinx-click = ">=3.0.1"
myst-parser = ">=2.0.0"
nox = ">=2021.6.12"
sphinx-autobuild = ">=2021.3.14"
sphinx-autodoc-typehints = "^1.23.2"
ruff = ">=0.5.1"
[project.urls]
Homepage = "https://github.com/sdss/lvmopstools"
Repository = "https://github.com/sdss/lvmopstools"
Documentation = "https://lvmopstools.readthedocs.org"

[tool.poetry.extras]
ds9 = ["pyds9"]
[project.scripts]
lvmopstools = "lvmopstools.__main__:lvmopstools"

[tool.black]
line-length = 88
target-version = ['py312']
fast = true
[tool.uv]
package = true
dev-dependencies = [
"ipython>=8.0.0",
"matplotlib>=3.1.1",
"doc8>=0.8.0",
"pytest>=5.2.2",
"pytest-asyncio>=0.10.0",
"pytest-cov>=2.8.1",
"pytest-mock>=1.13.0",
"pytest-sugar>=0.9.2",
"coverage[toml]>=5.0",
"ipdb>=0.12.3",
"rstcheck>=3.3.1",
"Sphinx>=4.0.0",
"furo>=2021.9.22",
"sphinx-copybutton>=0.4.0",
"sphinx-click>=3.0.1",
"sphinx-jsonschema>=1.16.11",
"myst-parser>=2.0.0",
"nox>=2021.6.12",
"sphinx-autobuild>=2021.3.14",
"sphinx-autodoc-typehints>=1.23.2",
"ruff>=0.6.1",
]

[tool.ruff]
line-length = 88
Expand All @@ -80,11 +70,12 @@ section-order = ["future", "standard-library", "typing", "third-party", "sdss",

[tool.ruff.lint.isort.sections]
typing = ["typing"]
sdss = ["sdsstools", "clu"]
sdss = ["sdsstools", "clu", "drift"]

[tool.pytest.ini_options]
addopts = "--cov lvmopstools --cov-report xml --cov-report html --cov-report term -W ignore"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = 'function'

[tool.coverage.run]
branch = true
Expand All @@ -103,5 +94,8 @@ exclude_lines = [
]

[build-system]
requires = ["poetry-core>=1.1.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.sdist]
only-include = ["src/lvmopstools"]
Loading

0 comments on commit 64204c0

Please sign in to comment.