Skip to content

Commit 12adad5

Browse files
authored
Merge pull request #89 from ToFuProject/Issue088_UV_dependencies
Issue088 uv dependencies
2 parents 2e9dc57 + 2eaf3e8 commit 12adad5

10 files changed

Lines changed: 169 additions & 255 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
push:
13+
tags:
14+
- '*'
15+
branches:
16+
- main
17+
release:
18+
types: [created]
19+
20+
jobs:
21+
pypi:
22+
name: Publish sdist to Pypi
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: astral-sh/setup-uv@v5
27+
with:
28+
python-version: '3.11'
29+
- run: uv build --sdist
30+
# Check that basic features work and we didn't miss to include crucial files
31+
- name: import test (sdist)
32+
run: uv run --isolated --no-project -p 3.11 --with dist/*.tar.gz spectrally/tests/prepublish.py
33+
- name: publish
34+
run: uv publish -t ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package wheels
10+
11+
on:
12+
push:
13+
tags:
14+
- '*'
15+
branches:
16+
- main
17+
release:
18+
types: [created]
19+
20+
jobs:
21+
pypi:
22+
name: Publish wheel to Pypi
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: [ubuntu-latest, windows-latest, macos-latest]
27+
python-version: ["3.10", "3.11", "3.12"]
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: astral-sh/setup-uv@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- run: uv build --wheel
35+
# Check that basic features work and we didn't miss to include crucial files
36+
- name: import test (wheel)
37+
run: uv run --isolated --no-project -p ${{ matrix.python-version }} --with dist/*.whl spectrally/tests/prepublish.py
38+
- name: publish
39+
run: uv publish -t ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-testing-matrix.yml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,24 @@ jobs:
1818
fail-fast: true
1919
matrix:
2020
os: [ubuntu-latest, windows-latest, macos-latest]
21-
python-version: ["3.8", "3.9", "3.10", "3.11"]
21+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2222

2323
steps:
24-
- uses: actions/checkout@v2
25-
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v2
24+
25+
# git checkout
26+
- uses: actions/checkout@v4
27+
28+
# Install uv
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v5
2731
with:
28-
python-version: ${{ matrix.python-version }}
29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
python -m pip install flake8 pytest
33-
pip install -r requirements.txt
34-
- name: Lint with flake8
35-
run: |
36-
# stop the build if there are Python syntax errors or undefined names
37-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
38-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
39-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
40-
- name: install spectrally
41-
run: |
42-
pip install -e ".[dev]" # --no-build-isolation
43-
- name: Test with pytest
44-
run: |
45-
pytest spectrally/tests -v -x
32+
python-version: ${{ matrix.python-version }}
33+
34+
# Install library
35+
- name: Install the project
36+
run: uv sync --all-extras --dev
37+
38+
# Run tests
39+
- name: Run tests
40+
# For example, using `pytest`
41+
run: uv run pytest spectrally/tests

CLASSIFIERS.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Development Status :: 5 - Production/Stable
2+
Intended Audience :: Science/Research
3+
Programming Language :: Python :: 3
4+
Programming Language :: Python :: 3.10
5+
Programming Language :: Python :: 3.11
6+
Programming Language :: Python :: 3.12
7+
Programming Language :: Python :: 3.13
8+
Programming Language :: Python :: 3.14
9+
Natural Language :: English

MANIFEST.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33
include MANIFEST.in
44
include LICENSE.txt
55
include pyproject.toml
6-
include _updateversion.py
7-
recursive-include spectrally/tests/input *
8-
recursive-include spectrally/ *.csv
6+
include CLASSIFIERS.txt

_updateversion.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

pyproject.toml

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,66 @@
11
[build-system]
2-
requires = ["setuptools>=40.8.0",
3-
"wheel",
4-
]
2+
requires = ["setuptools", "setuptools_scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
6+
[tool.setuptools]
7+
packages = ["spectrally", "spectrally.tests"]
8+
9+
10+
[tool.setuptools_scm]
11+
version_file = "spectrally/_version.py"
12+
13+
14+
[tool.setuptools.dynamic]
15+
classifiers = {file = ["CLASSIFIERS.txt"]}
16+
17+
18+
[project]
19+
name = "spectrally"
20+
readme = "README.md"
21+
license = {text = "MIT"}
22+
dynamic = ["version", "classifiers"]
23+
description = "Generic spectrum fitting library with multiple constraints"
24+
authors = [
25+
{name = "Didier VEZINET", email = "didier.vezinet@gmail.com"},
26+
]
27+
maintainers = [
28+
{name = "Didier VEZINET", email = "didier.vezinet@gmail.com"},
29+
]
30+
keywords = [
31+
"data", "spectrum fitting", "Collection",
32+
]
33+
# due to astropy >= 6.1 and to end-of-life of 3.9
34+
# see https://devguide.python.org/versions/
35+
requires-python = ">=3.10"
36+
dependencies = [
37+
"bsplines2d>=0.0.30",
38+
"pandas",
39+
"requests",
40+
]
41+
42+
43+
[project.urls]
44+
Homepage = "https://github.com/ToFuProject/spectrally"
45+
Issues = "https://github.com/ToFuProject/spectrally/issues"
46+
47+
48+
[project.entry-points."spectrally"]
49+
spectrally = "spectrally.scripts.spectrally_bash:main"
50+
spectrally-version = 'spectrally.scripts.spectrallyversion:main'
51+
specrally-custom = 'spectrally.scripts.spectrallycustom:main'
52+
53+
54+
[dependency-groups]
55+
dev = [
56+
"pytest",
57+
]
58+
59+
60+
[project.optional-dependencies]
61+
linting = [
62+
'ruff'
63+
]
64+
formatting = [
65+
'ruff'
66+
]

requirements.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)