diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml new file mode 100644 index 0000000..f159153 --- /dev/null +++ b/.github/workflows/build_wheels.yml @@ -0,0 +1,66 @@ +name: Build Wheels + +on: + push: + pull_request: + release: + types: + - created + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + # only build / deploy wheels on tag event + if: startsWith(github.event.ref, 'refs/tags') + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-14] + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Build wheels + uses: pypa/cibuildwheel@v2.23.2 + env: + CIBW_SKIP: pp* + CIBW_BUILD_FRONTEND: "build; args: --no-isolation" + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_BEFORE_BUILD: > + pip install "setuptools_dso" "epicscorelibs" "setuptools_scm[toml]>=6.2" "numpy>1.23" "setuptools>=45" + CIBW_REPAIR_WHEEL_COMMAND_LINUX: > + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(python scripts/get_library_paths.py) && + env | grep LIBRARY && + auditwheel repair -w {dest_dir} {wheel} + CIBW_REPAIR_WHEEL_COMMAND_MACOS: > + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(python scripts/get_library_paths.py) && + env | grep LIBRARY && + delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + CIBW_TEST_COMMAND: > + echo "wheel installed" && + python -c "import pyca; print(pyca)" && + python -c "import psp; print(psp)" + + with: + package-dir: . + output-dir: wheelhouse + config-file: "{package}/pyproject.toml" + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + - name: PyPI deployment + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + if [ -z "$TWINE_PASSWORD" ]; then + echo "# No PYPI_TOKEN secret in job!" | tee -a "$GITHUB_STEP_SUMMARY" + exit 1 + fi + twine upload --verbose dist/* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a079ad8..867adcd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ exclude: | repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: no-commit-to-branch - id: trailing-whitespace @@ -23,11 +23,11 @@ repos: - id: debug-statements - repo: https://github.com/pycqa/flake8.git - rev: 7.0.0 + rev: 7.2.0 hooks: - id: flake8 - repo: https://github.com/timothycrosley/isort - rev: 5.13.2 + rev: 6.0.1 hooks: - id: isort diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 9ecbe12..88d2761 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -1,10 +1,9 @@ {% set package_name = "pyca" %} {% set import_name = "pyca" %} -{% set data = load_setup_py_data() %} package: name: {{ package_name }} - version: {{ data.get('version') }} + version: "3.3.1" source: path: .. diff --git a/scripts/get_library_paths.py b/scripts/get_library_paths.py new file mode 100644 index 0000000..8361afe --- /dev/null +++ b/scripts/get_library_paths.py @@ -0,0 +1,11 @@ + +def get_library_paths(): + try: + from epicscorelibs.path import lib_path + print(lib_path) + except ImportError: + return + + +if __name__ == "__main__": + get_library_paths() \ No newline at end of file