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

Swap into using pyproject.toml and setup.cfg #135

Merged
merged 14 commits into from
Mar 28, 2023
Merged

Conversation

gnikit
Copy link
Member

@gnikit gnikit commented Aug 31, 2022

  • Moves the build from setup.py to setup.cfg and pyproject.toml, since setup.py will soon be deprecated.
  • Uses setuptools_scm for automatic version incrementation. Can be inferred from git and GitHub Releases
  • Updaes instructions on how to install
  • Drops Python 3.5 support, has reached EOL and setuptools_scm does not support it.

Fixes #132
Depends on #131 for README formatting

run: |
python -m pip install --upgrade pip
pip install build
python -m build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the motivation to work outside a venv here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pipx is strictly for console scripts with an entry point, pip is more permissive and allows for libraries and other packages. I would not impose pipx for the packaging step.

setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
@gnikit
Copy link
Member Author

gnikit commented Aug 31, 2022

@awvwgk do we need both conda and pypi test workflows? Because the conda-forge feedstock draws from GitHub I think we should only unittest PyPi from 3.6-3.11-dev

environment.yml Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
@awvwgk
Copy link
Member

awvwgk commented Aug 31, 2022

do we need both conda and pypi test workflows? Because the conda-forge feedstock draws from GitHub I think we should only unittest PyPi from 3.6-3.11-dev

I don't see much difference between testing against the Ubuntu packaged Python and the conda-forge packaged Python. The Python version range is open to discuss, we have a pure Python package, so there shouldn't be much surprises, but of course we might have to support even Python versions which reached EOL like Python 3.5 and 3.6. Not sure about testing development Python version.

There is no need to use a mix of Anaconda and pip when ti
comes to setting up testing environments. We can solely rely
on pip thus simplifying the CI workflows.
@gnikit
Copy link
Member Author

gnikit commented Sep 15, 2022

@awvwgk same here, ready to merge

Copy link
Collaborator

@pseewald pseewald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, I haven't reviewed this earlier because I'm not very confident with the tools employed here. Still, I suggest to merge this soon if there are no further comments from @awvwgk.

- name: Install project
run: pip install .
- name: Install project & dependencies
run: pip install .[dev]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work, how is .[dev] resolved?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is part of setuptools used to define optional requirements for the project. It reads this part from the setup.cfg file.

[options.extras_require]
dev =
    black
    isort
    pre-commit
    coveralls

In this case we use it to store and install the development dependencies.

For more info have a look: https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies

If you want we can completely ditch the setup.cfg file and move everything to pyproject.toml

@gnikit
Copy link
Member Author

gnikit commented Mar 27, 2023

@awvwgk are we happy with this or do you want me to make some changes?

Copy link
Member

@awvwgk awvwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ready to go.

@gnikit gnikit merged commit bb9c191 into master Mar 28, 2023
@gnikit gnikit deleted the feat/pyproject.toml branch March 28, 2023 09:29
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.

Update to pyproject.toml and setup.cfg
3 participants