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

[BBPBGLIB-1125] GH forkflow for building a wheel #121

Merged
merged 45 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
70a1552
GH forkflow for building a wheel
atemerev Feb 6, 2024
5e95dd3
WIP: wheels to pure pip
atemerev Feb 6, 2024
359ab5c
build sdist script
atemerev Feb 6, 2024
d428b67
[BBPBGLIB-1120] Remove node loaders for MVD3 and NCS (#117)
WeinaJi Feb 7, 2024
5404337
[BBPBGLIB-1124] Remove hoc targets related code (#118)
jorblancoa Feb 9, 2024
54dcb52
Remove SynapseReader.mod and SynReaderNRN (#122)
WeinaJi Feb 9, 2024
9b904a8
[BBPBGLIB-1110] Error now raised when executeConfigure is returned wi…
atemerev Feb 13, 2024
456f374
[BBPBGLIB-1127] Remove SpikeWriter.mod and out.dat (#123)
jorblancoa Feb 13, 2024
237c763
WIP PyPI
atemerev Feb 13, 2024
1c80618
WIP
atemerev Feb 15, 2024
a379243
WIP PyPI
atemerev Feb 15, 2024
6fd55d6
WIP
atemerev Feb 19, 2024
3ae68cf
WIP twine
atemerev Feb 19, 2024
c062bab
WIP twine/build
atemerev Feb 21, 2024
9cf2d24
Merge branch 'main' into atemerev/pypi-publish
atemerev Feb 21, 2024
550cff0
Yet another WIP with needs: []
atemerev Feb 21, 2024
d37f728
WIP
atemerev Feb 21, 2024
adf68aa
WIP PyPI-action
atemerev Feb 23, 2024
ba15338
WIP PyPI cleanup
atemerev Feb 23, 2024
0ffea8b
PyPI password -> token
atemerev Feb 23, 2024
61943ba
WIP
atemerev Feb 23, 2024
b42a7d0
WIP
atemerev Feb 23, 2024
2b3f450
setuptools_scm.local_scheme = no-local-version
heerener Feb 23, 2024
1bdc6c8
WIP fetch depth
atemerev Feb 23, 2024
4d67905
WIP fetch depth - push test
atemerev Feb 23, 2024
307ba1c
WIP fetch depth - push test
atemerev Feb 23, 2024
4f465d4
fetch tags
atemerev Feb 23, 2024
fb23749
Python version quoted
atemerev Feb 26, 2024
354607d
Merge branch 'main' into atemerev/pypi-publish
atemerev Feb 26, 2024
4438c8a
Python version requirement, prod PyPI
atemerev Feb 27, 2024
f35039f
No building deps
atemerev Feb 27, 2024
d8ddd0a
cleanup
atemerev Feb 27, 2024
94f7157
missing password
atemerev Feb 27, 2024
4513060
missing password
atemerev Feb 27, 2024
c176270
No more distutils
atemerev Feb 28, 2024
9c4b590
Python action from github; ubuntu 22.04
atemerev Feb 29, 2024
aed9626
Python minimum version 3.9
atemerev Feb 29, 2024
af7ebe9
trigger on tags only; upload to prod pypi
atemerev Feb 29, 2024
e099c46
add manual trigger option
atemerev Feb 29, 2024
fbf09d2
Merge branch 'main' into atemerev/pypi-publish
atemerev Feb 29, 2024
c95917b
Different steps on PR and pushing to tags
atemerev Mar 4, 2024
77907cd
Revert "Different steps on PR and pushing to tags"
atemerev Mar 7, 2024
24ce2e5
Reverted to steps, upload on push to tags
atemerev Mar 7, 2024
135ccef
Merge branch 'main' into atemerev/pypi-publish
atemerev Mar 7, 2024
9b2742b
Merge branch 'main' into atemerev/pypi-publish
atemerev Mar 11, 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
118 changes: 118 additions & 0 deletions .github/workflows/publish_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Publish sdist and wheels for macos, and manylinux, publish to pypi if a release
on: [pull_request, push]

env:
apt_options: -o Acquire::Retries=3

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}

if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-latest]

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.11'

- name: Cache HDF5 On Linux/macOS
if: runner.os == 'Linux' || runner.os == 'macOS'
uses: actions/cache@v3
id: cache-hdf5-posix
env:
cache-name: cache-hdf5-posix
with:
path: src-cache/
key: ${{ runner.os }}-build-${{ env.cache-name }}
atemerev marked this conversation as resolved.
Show resolved Hide resolved


- name: Build wheels on Linux
if: runner.os == 'Linux'
run: |
# note: config is stored in pyproject.toml now
pip wheel -w dist .

- name: Build wheels Mac OS
if: runner.os == 'macOS'

run: |
# x86_64 macOS allows for cross compilation; first we do arm64,
# only for the 11.0 target; and store in the cache the compiled code...
pip wheel -w dist .

# ...and now we do both targets for x86_64
unset MACOSX_DEPLOYMENT_TARGET
pip wheel -w dist .

- name: Store wheel as artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.whl

build_sdist:
name: Build sdist
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install packages
run: |
sudo apt-get ${{env.apt_options}} update -y
sudo apt-get ${{env.apt_options}} install -y libhdf5-dev
pip install neuron
pip install libsonata

- name: Build a source tarball, check it installs
run:
./ci/python_build_sdist.sh

- name: Store sdist as artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.tar.gz

# upload_artifacts:
# name: Upload wheels to PyPI
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
#
# runs-on: ubuntu-latest
# needs: [build_wheels, build_sdist]
#
# steps:
# - name: Download artifacts produced during the build_wheels and build_sdist jobs
# uses: actions/download-artifact@v3
# with:
# name: dist
# path: dist/
#
# - name: Display structure of downloaded files
# run: ls -R
# working-directory: dist
#
# - name: Publish package to PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.PYPI_PASSWORD }}
# packages_dir: dist/
27 changes: 27 additions & 0 deletions ci/python_build_sdist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

# build the sdist file, and try installing it

set -euo pipefail

BASE=$(pwd)/build/

mkdir -p "$BASE"

VENV="$BASE/venv-python-sdist/"
if [[ ! -d "$VENV" ]]; then
python3 -mvenv "$VENV"
fi
BIN="$VENV/bin/"

set +u # ignore missing variables in activation script
source "$BIN/activate"
set -u

"$BIN/pip" install -U setuptools pip twine
"$BIN/python" setup.py sdist
atemerev marked this conversation as resolved.
Show resolved Hide resolved

ls -al dist

cd "$VENV"
"$BIN/pip" --verbose install ../../dist/*.tar.gz
Loading