diff --git a/.github/workflows/publish_wheels.yml b/.github/workflows/publish_wheels.yml new file mode 100644 index 00000000..e9e5483e --- /dev/null +++ b/.github/workflows/publish_wheels.yml @@ -0,0 +1,40 @@ +name: Neurodamus Wheels + +on: [pull_request, push, workflow_dispatch] + +jobs: + wheel: + runs-on: ubuntu-22.04 + strategy: + matrix: + python_version: [3.11] + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python_version }} + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 500 + fetch-tags: true + - name: Build Wheel + run: | + cd $GITHUB_WORKSPACE + python${{ matrix.python_version }} -m pip install --upgrade build + # build wheel + python${{ matrix.python_version }} -m build . + - name: Test Wheel + run: | + cd $GITHUB_WORKSPACE + pip3 install tox + DIST_FILE=`ls dist/*whl` && tox --installpkg=$DIST_FILE -e ${{ matrix.python_version }} + - name: Upload Wheel + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + env: + PYPI_URL: ${{ secrets.PYPI_URL }} + PYPI_USER: ${{ secrets.PYPI_USER }} + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + run: | + pip3 install twine + python${{ matrix.python_version }} -m twine upload --username $PYPI_USER --password $PYPI_TOKEN dist/* diff --git a/pyproject.toml b/pyproject.toml index 39140d52..da80065c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ dependencies = [ "libsonata", "psutil" ] +requires-python=">=3.9" [project.optional-dependencies] plotting=['matplotlib'] # only for Neurodamus HL API @@ -39,14 +40,12 @@ Tracker = "https://github.com/BlueBrain/neurodamus/issues" exclude=["tests"] [tool.setuptools_scm] +local_scheme = "no-local-version" [tool.pytest.ini_options] addopts = "--verbose" markers = ["slow: marks tests as slow"] -[tool.distutils.bdist_wheel] -universal = 1 - [tool.flake8] exclude = [".*", "__pycache__", ".eggs", "*.egg", "build", "dist", "docs", "venv", "*.egg-info", "_benchmarks", "core"] extend-ignore = ["E127", "E221", "E226", "E701", "W503", "W504", "E731", "PT001", "PT023"]