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 3 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
32 changes: 8 additions & 24 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
name: Build and publish package
runs-on: ubuntu-22.04
cboulay marked this conversation as resolved.
Show resolved Hide resolved
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/[email protected]
python-version: "3.12"
- name: Build Package
run: uv build
- name: Publish package distributions to PyPI
run: uv publish
27 changes: 16 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Test

on: [push, pull_request]
on:
push:
branches: [main]
pull_request:
branches:
- main
- dev
cboulay marked this conversation as resolved.
Show resolved Hide resolved
workflow_dispatch:

jobs:
style:
Expand All @@ -17,22 +24,20 @@ 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
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
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: 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
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,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/
76 changes: 76 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[project]
name = "pyxdf"
description = "Python library for importing XDF (Extensible Data Format)"
authors = [
{ name = "Christian Kothe", email = "[email protected]" },
{ name = "Chadwick Boulay", email = "[email protected]" },
{ name = "Clemens Brunner", email = "[email protected]" }
]
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.9"
dynamic = ["version"]
keywords = [
"XDF",
"pyxdf",
"LSL",
"Lab Streaming Layer",
"file format",
"biosignals",
"stream",
]
classifiers = [
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 4 - Beta",

# Indicate who your project is intended for
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",

# Pick your license as you wish (see also "license" above)
"License :: OSI Approved :: BSD License",

"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",

# Specify the Python versions you support here.
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
cboulay marked this conversation as resolved.
Show resolved Hide resolved
]
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"

[project.optional-dependencies]
test = [
"pytest>=8.3.4",
]
dev = [
"ruff>=0.8.2",
]
cboulay marked this conversation as resolved.
Show resolved Hide resolved

[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]
cboulay marked this conversation as resolved.
Show resolved Hide resolved
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.
Empty file added test/__init__.py
cboulay marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
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
Loading