neuroinformatics-unit / python-cookiecutter

Utility to create a basic Python project structure with tests, CI etc.
BSD 3-Clause "New" or "Revised" License
20 stars 3 forks source link

[Feature] Allow distribution building CI to run with GitHub PR label #53

Closed dstansby closed 9 months ago

dstansby commented 1 year ago

Is your feature request related to a problem? Please describe. Some times it's useful to test that a distribution (both source and wheel) builds correctly with a pull request, especially if cibuildwheel is being used to build the wheels and changes to any compiled code have been made.

Describe the solution you'd like Over at https://github.com/brainglobe/bg-atlasapi/pull/144 I've implemented the option of running the distribution build when a specific label is added to a pull request. The config looks like:

  build_sdist_wheels:
    name: Build source distribution and wheel
    needs: [test]
    if: (
        github.event_name == 'push' && github.ref_type == 'tag'
      ) || (
        github.event_name == 'pull_request' &&
        contains(github.event.pull_request.labels.*.name, 'Test packaging')
      )

By default the distributions won't be created, but if the PR is labelled with a "Test packaging" label, then the distributions will be built.

Might be useful to include here, or might be a bit much? I thought I'd open this as an option either way 😄

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

alessandrofelder commented 1 year ago

Are there situations apart from the changes to compiled code (mentioned above) where one would want to test that a distribution builds correctly?

adamltyson commented 9 months ago

Closing to ensure simplicity of this cookiecutter