Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/python-publish-sdist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
push:
tags:
- '*'
branches:
- main
release:
types: [created]

jobs:
pypi:
name: Publish sdist to Pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: '3.11'
- run: uv build --sdist
# Check that basic features work and we didn't miss to include crucial files
- name: import test (sdist)
run: uv run --isolated --no-project -p 3.11 --with dist/*.tar.gz spectrally/tests/prepublish.py
- name: publish
run: uv publish -t ${{ secrets.PYPI_API_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/python-publish-wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package wheels

on:
push:
tags:
- '*'
branches:
- main
release:
types: [created]

jobs:
pypi:
name: Publish wheel to Pypi
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- run: uv build --wheel
# Check that basic features work and we didn't miss to include crucial files
- name: import test (wheel)
run: uv run --isolated --no-project -p ${{ matrix.python-version }} --with dist/*.whl spectrally/tests/prepublish.py
- name: publish
run: uv publish -t ${{ secrets.PYPI_API_TOKEN }}
40 changes: 18 additions & 22 deletions .github/workflows/python-testing-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,24 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2

# git checkout
- uses: actions/checkout@v4

# Install uv
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: install spectrally
run: |
pip install -e ".[dev]" # --no-build-isolation
- name: Test with pytest
run: |
pytest spectrally/tests -v -x
python-version: ${{ matrix.python-version }}

# Install library
- name: Install the project
run: uv sync --all-extras --dev

# Run tests
- name: Run tests
# For example, using `pytest`
run: uv run pytest spectrally/tests
9 changes: 9 additions & 0 deletions CLASSIFIERS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Programming Language :: Python :: 3
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3.14
Natural Language :: English
4 changes: 1 addition & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
include MANIFEST.in
include LICENSE.txt
include pyproject.toml
include _updateversion.py
recursive-include spectrally/tests/input *
recursive-include spectrally/ *.csv
include CLASSIFIERS.txt
33 changes: 0 additions & 33 deletions _updateversion.py

This file was deleted.

68 changes: 65 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,66 @@
[build-system]
requires = ["setuptools>=40.8.0",
"wheel",
]
requires = ["setuptools", "setuptools_scm"]
build-backend = "setuptools.build_meta"


[tool.setuptools]
packages = ["spectrally", "spectrally.tests"]


[tool.setuptools_scm]
version_file = "spectrally/_version.py"


[tool.setuptools.dynamic]
classifiers = {file = ["CLASSIFIERS.txt"]}


[project]
name = "spectrally"
readme = "README.md"
license = {text = "MIT"}
dynamic = ["version", "classifiers"]
description = "Generic spectrum fitting library with multiple constraints"
authors = [
{name = "Didier VEZINET", email = "didier.vezinet@gmail.com"},
]
maintainers = [
{name = "Didier VEZINET", email = "didier.vezinet@gmail.com"},
]
keywords = [
"data", "spectrum fitting", "Collection",
]
# due to astropy >= 6.1 and to end-of-life of 3.9
# see https://devguide.python.org/versions/
requires-python = ">=3.10"
dependencies = [
"bsplines2d>=0.0.30",
"pandas",
"requests",
]


[project.urls]
Homepage = "https://github.com/ToFuProject/spectrally"
Issues = "https://github.com/ToFuProject/spectrally/issues"


[project.entry-points."spectrally"]
spectrally = "spectrally.scripts.spectrally_bash:main"
spectrally-version = 'spectrally.scripts.spectrallyversion:main'
specrally-custom = 'spectrally.scripts.spectrallycustom:main'


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


[project.optional-dependencies]
linting = [
'ruff'
]
formatting = [
'ruff'
]
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

Loading
Loading