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

Switch to meson as build system #10

Merged
merged 61 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ccf642d
[TASK] python3.12 ready
PierreSchnizer Jul 10, 2024
73bc753
Merge branch 'main' of https://github.com/hz-b/bact-archiver
PierreSchnizer Jul 10, 2024
aaf40a5
Merge branch 'main' of https://github.com/hz-b/bact-archiver
PierreSchnizer Sep 26, 2024
2b13a42
[TASK] use meson build system
PierreSchnizer Sep 26, 2024
6afe4cf
[FIX] use build, no extra step for protoc
PierreSchnizer Sep 27, 2024
2b4cdac
[TASK] documented change to meson, new version
PierreSchnizer Sep 27, 2024
a504b3f
[FIX] build system: dependencies
PierreSchnizer Sep 27, 2024
cc30f5d
[FIX] included created python file
PierreSchnizer Sep 27, 2024
70dea72
[TASK] pypi publish
PierreSchnizer Dec 16, 2024
4a8769b
[Chk] flake not making errors:
PierreSchnizer Dec 16, 2024
1855c20
[FIX] removed debug
PierreSchnizer Dec 16, 2024
fc1b785
Merge pull request #11 from hz-b/PierreSchnizer-patch-1
PierreSchnizer Dec 16, 2024
5cfd80c
[TASK] use meson build system
PierreSchnizer Sep 26, 2024
e03dc4d
[FIX] use build, no extra step for protoc
PierreSchnizer Sep 27, 2024
9bdef6a
[TASK] documented change to meson, new version
PierreSchnizer Sep 27, 2024
2d924d0
[FIX] build system: dependencies
PierreSchnizer Sep 27, 2024
d7b0b52
[FIX] included created python file
PierreSchnizer Sep 27, 2024
a88935b
[TASK] as far as I could get: configure_file hack for handling create…
PierreSchnizer Sep 30, 2024
9404a07
[Snapshot] current development
PierreSchnizer Dec 16, 2024
6c3f3a6
Merge branch 'dev/feature/meson-build' of https://github.com/hz-b/bac…
PierreSchnizer Dec 16, 2024
5fac491
[Snapshot] on including generated python file
PierreSchnizer Dec 16, 2024
94ccb47
[TASK] use meson build system
PierreSchnizer Sep 26, 2024
c37405a
[TASK] documented change to meson, new version
PierreSchnizer Sep 27, 2024
4b8e12f
[FIX] build system: dependencies
PierreSchnizer Sep 27, 2024
cccc165
[FIX] included created python file
PierreSchnizer Dec 16, 2024
abe23f0
[Snapshot] on including generated python file
PierreSchnizer Dec 16, 2024
c167ce2
[Snapshot] compiling
PierreSchnizer Dec 16, 2024
53f72f5
[Snapshot] compiling and installing
PierreSchnizer Dec 16, 2024
a8cdd4c
[TASK] build wheel without using some shell
PierreSchnizer Dec 16, 2024
b17fd50
Merge branch 'dev/feature/meson-build' of https://github.com/hz-b/bac…
PierreSchnizer Dec 16, 2024
8e8c2c2
[TASK] now epics_event_pb2 ends up where it should
PierreSchnizer Dec 17, 2024
e0e011b
[TASK] cleanup, proto back where it should be
PierreSchnizer Dec 17, 2024
6ac84f2
[TASK] use meson build system
PierreSchnizer Sep 26, 2024
9ea55da
[FIX] use build, no extra step for protoc
PierreSchnizer Sep 27, 2024
932f70b
[TASK] documented change to meson, new version
PierreSchnizer Sep 27, 2024
8d96401
[FIX] build system: dependencies
PierreSchnizer Sep 27, 2024
55ae2e6
[FIX] included created python file
PierreSchnizer Sep 27, 2024
15c0434
[TASK] as far as I could get: configure_file hack for handling create…
PierreSchnizer Sep 30, 2024
2a502d4
[Snapshot] current development
PierreSchnizer Dec 16, 2024
8351d3b
[TASK] use meson build system
PierreSchnizer Sep 26, 2024
1abb098
[TASK] documented change to meson, new version
PierreSchnizer Sep 27, 2024
63409f7
[FIX] build system: dependencies
PierreSchnizer Sep 27, 2024
dedb5ef
[FIX] included created python file
PierreSchnizer Dec 16, 2024
dfc508c
[Snapshot] on including generated python file
PierreSchnizer Dec 16, 2024
e9f662a
[Snapshot] compiling
PierreSchnizer Dec 16, 2024
0b9ad2e
[Snapshot] compiling and installing
PierreSchnizer Dec 16, 2024
b56bc43
[TASK] build wheel without using some shell
PierreSchnizer Dec 16, 2024
fa3583a
[TASK] use meson build system
PierreSchnizer Sep 26, 2024
f40965e
[TASK] documented change to meson, new version
PierreSchnizer Sep 27, 2024
f13083e
[FIX] build system: dependencies
PierreSchnizer Sep 27, 2024
d6cae76
[FIX] included created python file
PierreSchnizer Sep 27, 2024
486bb74
[Snapshot] on including generated python file
PierreSchnizer Dec 16, 2024
a07f72f
[TASK] now epics_event_pb2 ends up where it should
PierreSchnizer Dec 17, 2024
3fab14d
[TASK] cleanup, proto back where it should be
PierreSchnizer Dec 17, 2024
8ec39c6
Merge branch 'dev/feature/meson-build' of https://github.com/hz-b/bac…
PierreSchnizer Dec 17, 2024
b1c435e
[FIX] cleanup
PierreSchnizer Dec 17, 2024
1d0ce77
[TASK] now only using pypi-publish
PierreSchnizer Dec 17, 2024
d479bf3
[TASK] add protoc, cleanup
PierreSchnizer Dec 17, 2024
d58a2e9
[FIX] spelling
PierreSchnizer Dec 17, 2024
b2c3362
[TASK] MANIFEST.in setup tools specific?
PierreSchnizer Dec 17, 2024
aee2c69
[TASK] actiavated matrix again
PierreSchnizer Dec 17, 2024
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
111 changes: 111 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Publish bact-archiver to PyPI and TestPyPI

on: push

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: ConorMacBride/install-package@v1
with:
apt: protobuf-compiler
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: python3 -m pip install build --user
- name: Build a source tarball (wheel would have to be manylinux )
run: python3 -m build --sdist
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish bact-archiver distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: Sign bact-archiver with Sigstore and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: ./dist/*.tar.gz
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'

publish-to-testpypi:
name: Publish bact-archiver to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/bact-archiver

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
12 changes: 5 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: False
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
numpy-version: [ "numpy<2.0" , "numpy>=2.0" ]

steps:
Expand All @@ -36,12 +36,11 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest wheel setuptools build
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install --upgrade pip wheel pytest flake8
# python -m pip install flake8 pytest wheel build
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: build and binary module
run: |
python setup.py build_proto_c
python -m pip wheel ./
python -m pip install ./

Expand All @@ -55,10 +54,9 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
find . -type f
(cd tests && python -m pytest --log-cli-level INFO)
35 changes: 0 additions & 35 deletions .github/workflows/python-publish.yml

This file was deleted.

4 changes: 4 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-09-27 Pierre Schnizer <[email protected]>
* meson build system: replaced setuptools with meson
build. facilites compiling

2021-04-16 Pierre Schnizer <[email protected]>

* archiver.getData: t0, t1 now required to be timezone aware
Expand Down
13 changes: 0 additions & 13 deletions MANIFEST.in

This file was deleted.

5 changes: 5 additions & 0 deletions bact_archiver/glob.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
for i in *.py;
do
echo "$i"
done
11 changes: 11 additions & 0 deletions bact_archiver/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
py_sources = run_command('/bin/sh',
['glob.sh'],
check : true
).stdout().strip().split('\n')

py.install_sources(
py_sources,
'archiver.cfg',
pure: false,
subdir: 'bact_archiver'
)
Loading
Loading