Skip to content

Commit 5a78d67

Browse files
authored
Merge pull request #213 from ToFuProject/Issue187_PyprojectToml
Issue187 pyproject toml - uv build
2 parents 141eb3c + 3cb6c85 commit 5a78d67

File tree

12 files changed

+111
-267
lines changed

12 files changed

+111
-267
lines changed

.github/workflows/python-publish.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,20 @@ on:
1919

2020
jobs:
2121
deploy:
22-
22+
name: Publish sdist to Pypi
2323
runs-on: ubuntu-latest
24-
2524
steps:
26-
- uses: actions/checkout@v2
27-
- name: Set up Python
28-
uses: actions/setup-python@v2
29-
with:
30-
python-version: '3.8'
31-
- name: Install dependencies
32-
run: |
33-
python -m pip install --upgrade pip
34-
pip install setuptools wheel twine build
35-
- name: Build package
36-
run: python -m build
37-
- name: Publish package
38-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
25+
- uses: actions/checkout@v4
26+
- uses: astral-sh/setup-uv@v5
27+
with:
28+
python-version: '3.11'
29+
- run: uv build
30+
# Check that basic features work and we didn't miss to include crucial files
31+
- name: Smoke test (wheel)
32+
run: uv run --isolated --no-project -p 3.11 --with dist/*.whl datastock/tests
33+
- name: Smoke test (source distribution)
34+
run: uv run --isolated --no-project -p 3.11 --with dist/*.tar.gz datastock/tests
35+
- run: uv publish --trusted-publishing always
3936
with:
4037
user: __token__
4138
password: ${{ secrets.PYPI_API_TOKEN }}

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

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,21 @@ jobs:
2121
python-version: ["3.8", "3.9", "3.10", "3.11"]
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 datastock
41-
run: |
42-
pip install -e ".[dev]" # --no-build-isolation
43-
- name: Test with pytest
44-
run: |
45-
pytest datastock/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 datastock/tests

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ __pycache__/
66
# C extensions
77
*.so
88

9+
# single sourcing verion file
10+
datastock/_version.py
11+
912
# Distribution / packaging
1013
.Python
1114
build/

CLASSIFIERS.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"Development Status :: 5 - Production/Stable"
2+
"Intended Audience :: Science/Research"
3+
"Programming Language :: Python :: 3"
4+
"Programming Language :: Python :: 3.6"
5+
"Programming Language :: Python :: 3.7"
6+
"Programming Language :: Python :: 3.8"
7+
"Programming Language :: Python :: 3.9"
8+
"Programming Language :: Python :: 3.10"
9+
"Programming Language :: Python :: 3.11"
10+
"Natural Language :: English"
11+
"License :: OSI Approved :: MIT License"

LICENSE renamed to LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 ToFuProject
3+
Copyright (c) 2023 ToFuProject
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
include MANIFEST.in
44
include LICENSE.txt
55
include pyproject.toml
6+
include CLASSIFIERS.txt

datastock/__init__.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
1+
# ###############
2+
# __version__
3+
# ###############
14

25

3-
from .version import __version__
6+
from . import _version
7+
__version__ = _version.version
8+
__version_tuple__ = _version.version_tuple
9+
10+
11+
# from setuptools_scm import get_version
12+
# __version__ = get_version(root='..', relative_to=__file__)
13+
14+
15+
# from importlib.metadata import version
16+
# __version__ = version(__package__)
17+
# cleanup
18+
# del get_version
19+
20+
21+
# ###############
22+
# sub-packages
23+
# ###############
24+
425

526
from . import _generic_check
627
from ._generic_utils_plot import *
728
from ._class import DataStock
829
from ._saveload import load, get_files
930
from ._direct_calls import *
10-
from . import tests
31+
from . import tests

datastock/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Do not edit, pipeline versioning governed by git tags!
2-
__version__ = '0.0.49'
2+
__version__ = '0.0.49-1-g545b8a4'

pyproject.toml

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,67 @@
1+
[build-system]
2+
requires = ["setuptools", "setuptools_scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
6+
[tool.setuptools.packages.find]
7+
where = ["datastock"]
8+
include = ["datastock*"]
9+
namespaces = false
10+
11+
12+
[tool.setuptools_scm]
13+
version_file = "datastock/_version.py"
14+
15+
16+
[tool.setuptools.dynamic]
17+
readme = {file = ["README.md"]}
18+
classifiers = {file = ["CLASSIFIERS.txt"]}
19+
20+
121
[project]
222
name = "datastock"
3-
license = {file = "LICENSE"}
4-
dynamic = ["version"]
23+
license = {text = "MIT"}
24+
dynamic = ["version", "readme", "classifiers"]
525
description = "Generic handler for multiple heterogenous numpy arrays and subclasses"
6-
readme = "README.md"
7-
requires-python = ">=3.6"
826
authors = [
9-
{name = "Didier VEZINET", email = "didier.vezinet@gmail.com"},
27+
{name = "Didier VEZINET", email = "didier.vezinet@gmail.com"},
1028
]
1129
maintainers = [
12-
{name = "Didier VEZINET", email = "didier.vezinet@gmail.com"},
30+
{name = "Didier VEZINET", email = "didier.vezinet@gmail.com"},
1331
]
14-
keywords = ["data", "analysis", "interactive", "heterogeneous arrays", "numpy", "Collection"]
15-
classifiers = [
16-
# How mature is this project? Common values are
17-
# 3 - Alpha
18-
# 4 - Beta
19-
# 5 - Production/Stable
20-
"Development Status :: 5 - Production/Stable",
21-
22-
# Indicate who your project is intended for
23-
"Intended Audience :: Science/Research",
24-
25-
# Specify the Python versions you support here.
26-
"Programming Language :: Python :: 3",
27-
"Programming Language :: Python :: 3.6",
28-
"Programming Language :: Python :: 3.7",
29-
"Programming Language :: Python :: 3.8",
30-
"Programming Language :: Python :: 3.9",
31-
"Programming Language :: Python :: 3.10",
32-
"Programming Language :: Python :: 3.11",
32+
keywords = [
33+
"data", "analysis", "interactive", "heterogeneous arrays", "numpy", "Collection",
3334
]
35+
requires-python = ">=3.8"
3436
dependencies = [
35-
"numpy",
36-
"scipy",
37-
"matplotlib",
38-
"astropy",
37+
"numpy",
38+
"scipy",
39+
"matplotlib",
40+
"PyQt5 ; platform_system != 'Windows'",
41+
# "PySide2; platform_system == 'Windows'",
42+
"astropy",
3943
]
4044

4145

42-
[build-system]
43-
requires = [
44-
"setuptools>=40.8.0, <64",
45-
"wheel",
46-
"Cython>=0.26",
47-
"numpy",
48-
]
46+
[project.urls]
47+
Homepage = "https://github.com/ToFuProject/datastock"
48+
Issues = "https://github.com/ToFuProject/datastock/issues"
49+
50+
51+
[project.entry-points."datastock"]
52+
datastock = "scripts.main:main"
53+
4954

5055
[dependency-groups]
5156
dev = [
5257
"pytest",
5358
]
5459

60+
5561
[project.optional-dependencies]
5662
linting = [
5763
'ruff'
5864
]
5965
formatting = [
6066
'ruff'
6167
]
62-
63-
[project.entry-points."datastock"]
64-
datastock = "scripts.main:main"

requirements.txt

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

0 commit comments

Comments
 (0)