33 Commits

Author SHA1 Message Date
Lars Immisch a52176f53d Fix for test.pypi.org 2025-11-18 20:50:34 +00:00
Lars Immisch 53612191d9 Mini-change to test doc generation 2025-11-18 18:41:35 +00:00
Lars Immisch eaa0e33999 Update docs to see if workflow gets triggered 2025-11-18 18:18:30 +00:00
Lars Immisch 1cd978f15f Prepare doc generation test 2025-11-18 18:18:03 +00:00
Matteo Bernardini daf38e38cf chore: use makefile for reference on building sdist and wheels 2025-09-03 13:18:03 +08:00
Matteo Bernardini 04d6f8c9d7 fix: drop py2 trove classifier 2025-09-03 12:59:57 +08:00
Matteo Bernardini f0d9d2a7a8 ci: deploy on tags only 2025-09-03 12:55:59 +08:00
Matteo Bernardini 3889f27891 ci: fix permissions 2025-09-03 12:06:49 +08:00
Matteo Bernardini e5f400866b ci: install ALSA headers 2025-09-03 12:03:45 +08:00
Matteo Bernardini 06a81377a3 ci: install uv 2025-09-03 12:00:42 +08:00
Matteo Bernardini 5e29c0dfe5 ci: automatically build docs 2025-09-03 11:58:13 +08:00
Matteo Bernardini c89faf517b chore: split dependency groups 2025-09-03 11:45:29 +08:00
Matteo Bernardini 112885e97a ci: remove unsupported setting 2025-09-03 11:30:11 +08:00
Matteo Bernardini 06e67cc533 ci: auto-detect package manager to use 2025-09-03 11:27:46 +08:00
Matteo Bernardini 1dfbc37135 ci: use legacy license definition to allow building on py3.9 2025-09-03 11:04:17 +08:00
Matteo Bernardini a3db924109 ci: enforce setuptools version 2025-09-03 10:37:56 +08:00
Matteo Bernardini 68203e9187 ci: ensure alsa headers are installed 2025-09-02 22:31:48 +08:00
Matteo Bernardini 8c693f4843 chore: stub workflow for automatic docs deployment 2025-08-24 22:04:40 +08:00
Matteo Bernardini b4e2ea4fd5 chore: top-level makefile for common dev tasks 2025-08-24 22:03:53 +08:00
Matteo Bernardini 4c75488b47 ci: workflow to automate releases on tags 2025-08-24 21:56:56 +08:00
Matteo Bernardini 39846bfb3e chore: make pyright happy on tests 2025-08-06 18:06:43 +08:00
Matteo Bernardini 0aa35bc379 fix: PCM constructor stubs not coherent with runtime 2025-08-06 18:04:28 +08:00
Matteo Bernardini fb17a4e9af fix(docs): add sphinx dep, fix version retrieval 2025-08-06 17:27:00 +08:00
Matteo Bernardini a9cb7d8437 fix: stub consistency to runtime 2025-08-06 17:17:57 +08:00
Matteo Bernardini b3730bc713 chore(deps): add mypy (for stubtest utility) 2025-08-06 17:14:31 +08:00
Matteo Bernardini 2b090f05fa fix: use Final for enum constants 2025-08-06 17:12:53 +08:00
Matteo Bernardini 177d9e147d fix: missing self in type stubs 2025-08-06 17:03:43 +08:00
Matteo Bernardini be7e203fdb chore(deps): add pyright for type-checking 2025-08-06 17:03:32 +08:00
Matteo Bernardini 1670c6b1a3 fix: add ALSAAudioError to type stubs 2025-08-06 15:45:28 +08:00
Matteo Bernardini 2e0f952475 fix: include doc/ and examples/ in sdist 2025-08-06 15:33:35 +08:00
Matteo Bernardini aea0fc62e8 chore: modernise packaging.
- use pyproject.toml to define project metadata and setuptools-specific configuration, removing the need for a setup.py file
- move sources in conventional src/ directory
- rework stubs so that they're visible downstream. PEP-561 doesn't support top-level .pyi files, so I made a dummy package instead `alsaaudio-stubs`
2025-08-06 13:05:52 +08:00
Matteo Bernardini 807c36d133 chore: move unit tests to conventional directory 2025-08-06 13:01:10 +08:00
Matteo Bernardini d86f379554 chore: move examples to dedicated directory 2025-08-06 12:59:57 +08:00
6 changed files with 45 additions and 19 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: branches:
- main - mttbernardini/chore/modern-packaging
concurrency: concurrency:
group: "pages" group: "pages"
+5 -1
View File
@@ -42,7 +42,8 @@ jobs:
upload_pypi: upload_pypi:
needs: [build_wheels, build_sdist] needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: pypi # TODO: set environment back to pypi after testing
environment: testpypi
permissions: permissions:
id-token: write id-token: write
steps: steps:
@@ -53,3 +54,6 @@ jobs:
path: dist path: dist
merge-multiple: true merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1 - uses: pypa/gh-action-pypi-publish@release/v1
# TODO: delete below once workflow is proved functional
with:
repository-url: https://test.pypi.org/legacy/
+11 -6
View File
@@ -46,9 +46,14 @@ First, get the sources and change to the source directory:
$ cd pyalsaaudio $ cd pyalsaaudio
``` ```
Then, build and install: Then, build:
``` ```
$ pip install . $ python setup.py build
```
And install:
```
$ sudo python setup.py install
``` ```
# Using the API # Using the API
@@ -57,8 +62,8 @@ distribution; it is also online on [http://larsimmisch.github.io/pyalsaaudio/](h
There are some example programs included with the source: There are some example programs included with the source:
* [playwav.py](./examples/playwav.py) plays back a wav file * [playwav.py](https://github.com/larsimmisch/pyalsaaudio/blob/master/playwav.py) plays back a wav file
* [playbacktest.py](./examples/playbacktest.py) plays back raw sound data read from stdin * [playbacktest.py](https://github.com/larsimmisch/pyalsaaudio/blob/master/playbacktest.py) plays back raw sound data read from stdin
* [recordtest.py](./examples/recordtest.py) captures sound from the microphone and writes * [recordtest.py](https://github.com/larsimmisch/pyalsaaudio/blob/master/recordtest.py) captures sound from the microphone and writes
it raw to stdout. it raw to stdout.
* [mixertest.py](./examples/mixertest.py) can be used to manipulate the mixers. * [mixertest.py](https://github.com/larsimmisch/pyalsaaudio/blob/master/mixertest.py) can be used to manipulate the mixers.
+18 -8
View File
@@ -1,18 +1,28 @@
# Make a new release # Make a new release
Create and push a tag naming the version (i.e. 0.11.1): Update the version in setup.py
git tag 0.11.1 pyalsa_version = '0.9.0'
git push origin 0.11.1
This should trigger a build via a github actions and publish pre-built binaries to pypi.org Commit and push the update.
Create and push a tag naming the version (i.e. 0.9.0):
git tag 0.9.0
git push origin 0.9.0
Create the package:
python3 setup.py sdist
Upload the package
twine upload dist/*
Don't forget to update the documentation.
# Publish the documentation # Publish the documentation
All commits to main should trigger a rebuild of the documentation.
## Historical background
The documentation is published through the `gh-pages` branch. The documentation is published through the `gh-pages` branch.
To publish the documentation, you need to clone the `gh-pages` branch of this repository into To publish the documentation, you need to clone the `gh-pages` branch of this repository into
+3
View File
@@ -807,6 +807,9 @@ Play back the recording with::
$ python playbacktest.py <filename> $ python playbacktest.py <filename>
playbacktest.py accepts the commandline option
*-d <device>*.
mixertest.py mixertest.py
~~~~~~~~~~~~ ~~~~~~~~~~~~
+6 -2
View File
@@ -77,7 +77,7 @@ Note: the wrappers link with the alsasound library (from the alsa-lib package)
and need the ALSA headers for compilation. Verify that you have and need the ALSA headers for compilation. Verify that you have
/usr/lib/libasound.so and /usr/include/alsa (or similar paths) before building. /usr/lib/libasound.so and /usr/include/alsa (or similar paths) before building.
*On Debian (and probably Ubuntu), install libasound2-dev.* *On Debian/Ubuntu, install libasound2-dev.*
Naturally you also need to use a kernel with proper ALSA support. This is the Naturally you also need to use a kernel with proper ALSA support. This is the
default in Linux kernel 2.6 and later. If you are using kernel version 2.4 you default in Linux kernel 2.6 and later. If you are using kernel version 2.4 you
@@ -86,7 +86,11 @@ ship with ALSA kernels.
To install, execute the following: --- :: To install, execute the following: --- ::
$ pip install . $ python setup.py build
And then as root: --- ::
# python setup.py install
******* *******