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

Support publishing to PyPI #56

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ebrahimebrahim
Copy link

This adds support for publishing to PyPI by transitioning from the legacy setup.py to pyproject.toml.

The changes are adapted from the output of cookiecutter scientific-python/cookie based off scientific-python/cookie@8c0a1627. See https://learn.scientific-python.org/development/

Changes include:

  • GitHub workflows for continuous integration (ci.yml) and continuous development (cd.yml). Each time a GitHub Release is created, it triggers the build, test, and publishing of wheels.
    • (The pytest CI is placeholder infrastructure in case there is a desire to add unit tests in the future)
  • Infrastructure for building sphinx-based documentation.
  • Extraction of package version from source control by leveraging setuptools-scm. Note that generated source distribution will include the relevant version metadata.
  • Pre-commit hooks for checking style.
    • To start with, linting exceptions have been added to pyproject.toml to ignore the style constraints that are not initially satisfied and that could not be safely auto-fixed. Subsequent commits can remove the exceptions and make style changes if there is a desire to do that in the future.
  • Dependabot configuration

The major benefit of this proposed update is that HD_BET can be more easily maintained and automatically published to PyPI upon release. This helps bring HD_BET further into the larger python neuroimaging ecosystem by allowing other packages to mark it as a dependency.

The only required step on your side will be to create a pending publisher on PyPI so that the GitHub workflow can automatically publish the package upon release creation. Would be happy to provide more details on any of this.

Files updated using `end-of-file-fixer`, `mixed-line-ending`, `trailing-whitespace`,
`blacken-docs` and `mirrors-prettier` pre-commit hooks
This will make it possible to switch from setup.py to pyproject.toml
in a shortly upcoming commit
Adapt repo based on the cookiecutter at scientific-python/cookie@8c0a1627
This enables CI/CD, adds dependabot configuration, pre-commit configuration,
and several other things.
@ebrahimebrahim
Copy link
Author

ebrahimebrahim commented Jun 18, 2024

@FabianIsensee What do you think of this approach to publishing the project and automating some of the routine maintenance? Happy to provide some help in keeping this wonderful project alive!

@FabianIsensee
Copy link
Member

Hey, thanks for the PR. This project is no longer actively developed and I welcome ways of reducing the amount of work we have to invest into keeping it running for everyone.
Can you please enlighten me how I can integrate the automatic pypi publishing once it is merged?

@ebrahimebrahim
Copy link
Author

Once it is merged the steps to publish would be:

(The "automatic" aspect of it is that the publish step is triggered automatically whenever you create a release on github. This is achieved by the configuration in the cd.yml file that is added in this PR)

@FabianIsensee
Copy link
Member

Thanks, will do.
Might need some more days because I need to fix some things on our end

@ebrahimebrahim
Copy link
Author

@FabianIsensee Let me know if there are any more questions I can answer or anything I can help with to move this along

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.

2 participants