Skip to content

Commit

Permalink
pdm based build system
Browse files Browse the repository at this point in the history
  • Loading branch information
adehad committed May 7, 2024
1 parent 06dcd8a commit dab29f6
Show file tree
Hide file tree
Showing 11 changed files with 390 additions and 85 deletions.
53 changes: 40 additions & 13 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,54 @@ on:

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
run: python -m pip install --upgrade pdm
- name: Add msbuild to PATH
if: ${{ runner.os == 'Windows' }}
uses: microsoft/setup-msbuild@v2
- name: Build package
run: |
python -m pip install . -v
run: pdm build -v
- name: Install
if: ${{ matrix.python-version == '3.11' }}
run: pdm install -G:all
- name: Test with pytest
run: |
pytest
if: ${{ matrix.python-version == '3.11' }}
run: pdm test
- name: Lint
if: ${{ matrix.python-version == '3.11' }}
run: pdm lint
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: build-py${{ matrix.python-version }}-${{ matrix.os }}
path: dist
retention-days: 5

combine_wheels:
runs-on: ubuntu-latest
needs: build

steps:
- name: Download wheels artifact
uses: actions/download-artifact@v4
with:
merge-multiple: 'true'
path: wheels
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: wheels
path: wheels
retention-days: 5
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ pip-delete-this-directory.txt

# Sphinx documentation
docs/_build/

# pdm
.pdm-python
46 changes: 0 additions & 46 deletions README.txt

This file was deleted.

324 changes: 324 additions & 0 deletions pdm.lock

Large diffs are not rendered by default.

35 changes: 22 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
[build-system]
requires = [
"setuptools>=51.0",
"wheel>=0.36",
"numpy==1.22"
]
build-backend = "setuptools.build_meta"
requires = ["pdm-backend", "numpy==1.22"]
build-backend = "pdm.backend"

[project]
name = "lttbc"
version = "0.2.4"
description ="Largest triangle three buckets module for Python written in C"
dynamic = ["readme"]
description = "Largest triangle three buckets module for Python written in C"
requires-python = ">=3.8"
authors = [
{name = "European XFEL GmbH", email = "dennis.goeries@xfel.eu"}
{ name = "European XFEL GmbH", email = "dennis.goeries@xfel.eu" },
]
maintainers = [
{name = "Dennis Goeries", email = "dennis.goeries@xfel.eu"},
{ name = "Dennis Goeries", email = "dennis.goeries@xfel.eu" },
]
dependencies = [
"numpy>=1.22",
]
license = {text = "MIT"}
license = { text = "MIT" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand All @@ -35,9 +30,23 @@ classifiers = [
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Visualization",
]
readme = "README.md"

[project.urls]
"git" = "https://github.com/dgoeries/lttbc"

[tool.pdm.dev-dependencies]
lint = [
"flake8",
]
test = ["pytest", "pytest-cov"]

[tool.pdm.scripts]
test = "pytest tests"
lint = "flake8 src/"

[tool.pdm]
distribution = true

[tool.setuptools.dynamic]
readme = {file = ["README.txt"], content-type = "text/markdown"}
[tool.pdm.build]
run-setuptools = true # run setup.py for the C Extension
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __str__(self):
return numpy.get_include()


lttbc_py = Extension("lttbc", sources=["lttbc.c"],
lttbc_py = Extension("lttbc", sources=["src/lttbc/lttbc.c"],
define_macros=[
("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
include_dirs=[numpy_get_include(),
Expand Down
File renamed without changes.
Empty file added tests/__init__.py
Empty file.
File renamed without changes.
11 changes: 0 additions & 11 deletions tox.ini

This file was deleted.

0 comments on commit dab29f6

Please sign in to comment.