-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from CerebusOSS/14_simple_design_improvements
misc design improvements
- Loading branch information
Showing
19 changed files
with
434 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,26 @@ | ||
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
name: Publish Python 🐍 distributions 📦 to PyPI | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
build: | ||
name: build and upload release to PyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
environment: "release" | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
pip install -e . | ||
- name: Test with pytest | ||
run: | | ||
pytest | ||
- name: Install pypa/build | ||
run: >- | ||
pip install build --user | ||
- name: Build a source tarball and a binary wheel | ||
run: >- | ||
python3 -m build --sdist --wheel --outdir dist/ . | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v2 | ||
|
||
- name: Publish distribution 📦 to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true | ||
- name: Build Package | ||
run: uv build | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
- name: Publish package distributions to PyPI | ||
run: uv publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Test package | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
python-version: [3.9, "3.10", "3.11", "3.12"] | ||
os: | ||
- "ubuntu-latest" | ||
- "windows-latest" | ||
- "macos-latest" | ||
runs-on: ${{matrix.os}} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v2 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
run: uv python install ${{ matrix.python-version }} | ||
|
||
- name: Install the project | ||
run: uv sync --all-extras --dev | ||
|
||
# - name: Lint | ||
# run: | ||
# uv tool run ruff check --output-format=github src | ||
|
||
- name: Run tests | ||
run: uv run pytest tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,42 @@ | ||
[tool.poetry] | ||
[project] | ||
name = "pycbsdk" | ||
version = "0.1.4" | ||
description = "Pure Python interface to Blackrock Neurotech Cerebus devices" | ||
authors = ["Chadwick Boulay <[email protected]>"] | ||
authors = [ | ||
{ name = "Chadwick Boulay", email = "[email protected]" }, | ||
] | ||
license = "MIT" | ||
readme = "README.md" | ||
packages = [ | ||
{ include = "pycbsdk", from = "src" } | ||
requires-python = ">=3.9" | ||
dynamic = ["version"] | ||
dependencies = [ | ||
"numpy", | ||
"aenum>=3.1.15", | ||
"ifaddr>=0.2.0", | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.9,<3.13" | ||
numpy = "^1.26.4" | ||
aenum = "^3.1.15" | ||
ifaddr = "^0.2.0" | ||
[project.optional-dependencies] | ||
test = [ | ||
"pytest>=8.3.3", | ||
] | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
typer = "^0.9.0" | ||
pytest = "^8.1.1" | ||
[project.scripts] | ||
pycbsdk-rates = "pycbsdk.examples.print_rates:main" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
requires = ["hatchling", "hatch-vcs"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
|
||
[tool.poetry.scripts] | ||
ezmsg-monitor = "pycbsdk.examples.print_rates:main" | ||
[tool.hatch.build.hooks.vcs] | ||
version-file = "src/pycbsdk/__version__.py" | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/pycbsdk"] | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
"ruff>=0.6.8", | ||
"typer>=0.12.5", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
import importlib.metadata | ||
|
||
|
||
__version__ = importlib.metadata.version("pycbsdk") | ||
from .__version__ import __version__ as __version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.