Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to uv builds #126

Merged
merged 8 commits into from
Dec 6, 2024
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: 9 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,15 @@ jobs:

build:
needs: style
name: Build package
runs-on: ubuntu-22.04
name: Build and publish package
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: '3.12'
- name: Build sdist and wheel
run: |
pip install build
python -m build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist

upload-pypi:
name: Upload to PyPI
needs: build
runs-on: ubuntu-22.04
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@v1.9.0
python-version: "3.12"
- name: Build Package
run: uv build
- name: Publish package distributions to PyPI
run: uv publish
26 changes: 13 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Test

on: [push, pull_request]
on:
push:
branches: [main]
pull_request:
branches:
- main
workflow_dispatch:

jobs:
style:
Expand All @@ -17,22 +23,16 @@ jobs:
needs: style
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ["3.9", "3.10", "3.11", "3.12"]
cbrnr marked this conversation as resolved.
Show resolved Hide resolved
name: Run tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build sdist and wheel
run: |
pip install build
python -m build
- name: Install wheel
run: pip install "$(pwd)/$(echo dist/pyxdf*.whl)[dev]"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Build
run: uv sync --all-extras
- name: Run tests
run: |
git clone https://github.com/xdf-modules/example-files.git
pip install pytest
pytest
uv run pytest
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ venv/
ENV/
env.bak/
venv.bak/
uv.lock

# Spyder project settings
.spyderproject
Expand All @@ -107,5 +108,11 @@ venv.bak/
.idea

# cython temporaries
/pyxdf/pyxdf.c
/pyxdf/pyxdf.html
/src/pyxdf/pyxdf.c
/src/pyxdf/pyxdf.html

# Dynamic version file
/src/pyxdf/__version__.py

# Test files
example-files/
63 changes: 63 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[project]
name = "pyxdf"
description = "Python library for importing XDF (Extensible Data Format)"
authors = [
{ name = "Christian Kothe", email = "christian.kothe@intheon.io" },
{ name = "Chadwick Boulay", email = "chadwick.boulay@gmail.com" },
{ name = "Clemens Brunner", email = "clemens.brunner@gmail.com" }
]
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.9"
dynamic = ["version"]
keywords = [
"XDF",
"pyxdf",
"LSL",
"Lab Streaming Layer",
"file format",
"biosignals",
"stream",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: BSD License",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"numpy>=2.0.2",
]

[project.urls]
Repository = "https://github.com/xdf-modules/pyxdf"
Issues = "https://github.com/xdf-modules/pyxdf/issues"
Changelog = "https://github.com/xdf-modules/pyxdf/blob/main/CHANGELOG.md"

[dependency-groups]
dev = [
"pytest>=8.3.4",
"ruff>=0.8.2",
]

[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/pyxdf/__version__.py"

[tool.hatch.build.targets.wheel]
packages = ["src/pyxdf"]
15 changes: 0 additions & 15 deletions pyxdf/__init__.py

This file was deleted.

7 changes: 0 additions & 7 deletions setup.cfg

This file was deleted.

61 changes: 0 additions & 61 deletions setup.py

This file was deleted.

4 changes: 4 additions & 0 deletions src/pyxdf/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .__version__ import __version__ as __version__
from .pyxdf import load_xdf, match_streaminfos, resolve_streams

__all__ = ["load_xdf", "resolve_streams", "match_streaminfos"]
Empty file added src/pyxdf/cli/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pyxdf/test/test_data.py → test/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pyxdf import load_xdf

# requires git clone https://github.com/xdf-modules/example-files.git
# into the root xdf-python folder
# into the root pyxdf folder
path = Path("example-files")
extensions = ["*.xdf", "*.xdfz", "*.xdf.gz"]
files = []
Expand Down
File renamed without changes.
Loading