-
Notifications
You must be signed in to change notification settings - Fork 8
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 #14 from jaqx0r/pyproject
build: Single-source the release version from git.
- Loading branch information
Showing
4 changed files
with
84 additions
and
32 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,17 +1,40 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
# none-all, which doesn't exist, but | ||
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow | ||
# implies that the token still gets created, and | ||
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token | ||
# shows what the default permissions are, which are more than `none`. | ||
# Elsewhere we learn that any permission not mentioned here gets turned to | ||
# `none`. So setting a single permission to none causes all to be `none`. | ||
actions: none | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
fetch-depth: 0 # get all tags | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: install dependencies | ||
run: sudo apt-get install -y libmad0-dev | ||
- name: build | ||
run: | | ||
python config_unix.py | ||
python setup.py build | ||
python -m compileall -f . | ||
sudo apt-get install -y libmad0-dev | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade pytest | ||
- name: install | ||
run: | | ||
python -m pip install . | ||
- name: test | ||
run: | | ||
pytest |
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,19 @@ | ||
[build-system] | ||
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] | ||
|
||
[project] | ||
name = "pymad" | ||
dynamic = ["version"] | ||
description = "A wrapper for the MAD (mpeg audio decoder) library." | ||
authors = [ | ||
{name="Jamie Wilkinson",email="jaq@spacepants.org"}, | ||
] | ||
readme = "README.md" | ||
license = {text = "GPL-2.0"} | ||
|
||
[project.urls] | ||
Homepage = "https://spacepants.org/src/pymad" | ||
Repository = "https://github.com/jaqx0r/pymad" | ||
|
||
[tool.setuptools_scm] | ||
tag_regex = '^version/(?P<version>[^\+]+)(?P<suffix>.*)?$' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
import sys | ||
|
||
sys.path.insert(0, os.path.abspath("..")) | ||
print(sys.path) | ||
|
||
from importlib.metadata import version | ||
|
||
|
||
def test_import(): | ||
import mad | ||
|
||
print("Package version:", mad.__version__) | ||
print("Expected metadata version:", version("pymad")) | ||
|
||
assert mad.__version__ == version("pymad") |