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

Develop/3.12 #31

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
62 changes: 43 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
strategy:
fail-fast: False
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -41,8 +41,9 @@ jobs:
ls -al ./dist
- name: Place wheels in artifacts folder
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: windows-${{ matrix.python-version }}
path: ./dist/*.whl

build_wheels_unix:
Expand All @@ -59,7 +60,7 @@ jobs:
submodules: true

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'

Expand All @@ -78,8 +79,9 @@ jobs:
ls -R dist
- name: Place wheels in artifacts folder
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
path: ./dist/*.whl

test-wheels:
Expand All @@ -89,23 +91,27 @@ jobs:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest, macos-latest ]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Retrieve packages
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: dist

- name: List items
run: |
ls -alR dist
- name: Test Package Installation
run: |
python -m pip install --upgrade pip
Expand All @@ -131,34 +137,52 @@ jobs:
python extern/nlopt/test/t_python.py
deploy:
name: deploy packages
name: Deploy packages
runs-on: ubuntu-latest
needs: test-wheels
if: startsWith(github.ref, 'refs/tags/')
if: ${{ !startsWith(github.ref, 'refs/tags/') }}

steps:
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Retrieve packages
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- name: Install twine
run: pip install twine

- name: Move files to top level directory
run: |
ls -ltR dist
python - << EOF
from pathlib import Path
import shutil
d = Path('dist')
for f in d.rglob('*.whl'):
shutil.move(f, d / f.name)
for f in d.iterdir():
if f.is_dir():
shutil.rmtree(f)
EOF
- name: Upload packages to testpypi
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_TEST_UID }}
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PWD }}
run: python -m twine upload --skip-existing --repository testpypi dist/*
TWINE_USERNAME: ${{ secrets.PYPI_TEST_TOKEN_NAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }}
run: python -m twine upload --skip-existing --repository testpypi dist/* --verbose

- name: Upload packages to pypi
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: ${{ secrets.PYPI_UID }}
TWINE_PASSWORD: ${{ secrets.PYPI_PWD }}
run: python -m twine upload --skip-existing dist/*
TWINE_USERNAME: ${{ secrets.PYPI_PROD_TOKEN_NAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PROD_API_TOKEN }}
run: python -m twine upload --skip-existing dist/* --verbose
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12.2
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

from extensions import NLOptBuild, NLOptBuildExtension

from wheel.bdist_wheel import bdist_wheel

with open("README.md") as f:
long_description = f.read()

Expand Down
Loading