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

WIP: Switch to poetry #405

Merged
merged 7 commits into from
Oct 24, 2023
Merged

WIP: Switch to poetry #405

merged 7 commits into from
Oct 24, 2023

Conversation

zStupan
Copy link
Contributor

@zStupan zStupan commented Oct 24, 2023

Summary

  • Switched from Pipenv to poetry for dependency management.
  • Removed unnecessary config files.
  • Updated the main workflow.
  • Updated docs
  • The minimum required python version is now 3.9.
  • Moved tests out of the niapy package.
  • Closes Switch to Poetry #403
  • Closes Program versions #400

TODO:

  • I haven't figured out the publishing to pypi and conda workflows/config yet
  • Use ruff for linting and fixing code style errors. The config can be written directly to pyproject.toml.

@firefly-cpp
Copy link
Contributor

Thanks, @zStupan

@firefly-cpp
Copy link
Contributor

LGTM

@firefly-cpp firefly-cpp merged commit 59bae04 into NiaOrg:master Oct 24, 2023
13 of 15 checks passed
@firefly-cpp
Copy link
Contributor

@GregaVrbancic, can you try to build it and publish a new release on Pypi?

@zStupan
Copy link
Contributor Author

zStupan commented Oct 24, 2023

I'm not sure about conda, but this is a workflow that should work for PyPI:

name: Build and Publish NiaPy Pypi Package

on:
  release:
    types: [published]

jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

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

      - name: Install Poetry
        run: |
          curl -sSL https://install.python-poetry.org | python - -y

      - name: Update PATH
        run: echo "$HOME/.local/bin" >> $GITHUB_PATH

      - name: Build project for distribution
        run: poetry build

      - name: Check Version
        id: check-version
        run: |
          [[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || echo prerelease=true >> $GITHUB_OUTPUT

      - name: Publish to PyPI
        env:
          POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
        run: poetry publish

based on: https://github.com/python-poetry/poetry/blob/master/.github/workflows/release.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to Poetry Program versions
2 participants