Skip to main content

Testing GitHub actions, Cirrus CI, documentation, and publishing releases of Python packages.

Project description

workflow-sandbox

Build Status Code style: black License PyPI Python Version

Testing GitHub actions, Cirrus CI, documentation, and publishing releases of Python packages.

This will be a Python package on test PyPI in its own right, with package name workflow-sandbox and module name workflow_sandbox (yes, the mixing of hyphenation and underscores is inelegant but deliberate).

Inception

This repository was created on GitHub using the following settings.

GitHub Create a new repository settings

Development environment

To develop this package, I first cloned the repository (others would fork on GitHub then clone their fork):

$ git clone https://github.com/<origin>/workflow-sandbox.git
$ cd workflow-sandbox

where <origin> is the GitHub account of the fork.

For now, I'm going to use <origin>=rpanderson and not work on a fork.

If you are developing on a fork, set the upstream remote:

$ git remote add upstream https://github.com/<upstream>/workflow-sandbox.git

where <upstream> is the base repository used for pull requests and publishing releases and documentation. If you forked your development repository from https://github.com/rpanderson/workflow-sandbox for example, you'd use <upstream>=rpanderson.

Create a virtual environment:

$ python -m venv .venv
$ .venv\Scripts\activate
$ python -m pip install --upgrade pip setuptools wheel

Roadmap

The first port of call will be to test:

CirrusCI

  • Formatting using black.
  • Linting using flake8.
  • Hosting documentation using GitHub pages (on an orphaned gh-pages branch).

GitHub actions

  • Create release using actions/create_release: :
jobs:
  release:
    name: Release
    env:
      VERSION: ${${{ github.ref }}//v}
    ...
    steps:
      ...
      # Only publish tagged merges elsewhere
      - name: Create GitHub Release
        if: startsWith(github.event.ref, 'refs/tags') && startsWith(github.ref, 'v')
        id: create_release
        uses: actions/create-release@latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref }}
          release_name: ${{ env.VERSION }}
          draft: true
          prerelease: ${{ contains(github.ref, 'rc') }}
  • Publish release on GitHub using actions/upload-release-asset with the body above extracted from the appropriate release notes based on git tags, similar to napari/napari#1138.

  • Using pypa/gh-action-pypi-publish:

    • Publish releases (and release candidates) on PyPI.
    • Publish merges into master branch (including untagged development versions) to TestPyPI with an appropriate dev version suffix.

Acknowledgements

Much of this is guided by the practices of other development communities—especially napari (and, increasingly, labscript-suite)—and many helpful conversations with @chrisjbillington and @philipstarkey.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

workflow-sandbox-0.3.1rc1.tar.gz (54.9 kB view details)

Uploaded Source

Built Distribution

workflow_sandbox-0.3.1rc1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file workflow-sandbox-0.3.1rc1.tar.gz.

File metadata

  • Download URL: workflow-sandbox-0.3.1rc1.tar.gz
  • Upload date:
  • Size: 54.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for workflow-sandbox-0.3.1rc1.tar.gz
Algorithm Hash digest
SHA256 1a8781b183b309dea257366b9f1e6462ab7aa744d18652d8e4a350268fea877f
MD5 d10e97bda90940b8ce0f420ad3a1eaab
BLAKE2b-256 b9a01261cf9041b0fd3c91c4ad81b030b427fe40ec60c89e5601a3cd06097dee

See more details on using hashes here.

File details

Details for the file workflow_sandbox-0.3.1rc1-py3-none-any.whl.

File metadata

  • Download URL: workflow_sandbox-0.3.1rc1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for workflow_sandbox-0.3.1rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 60f46af3a5c948fcfba72cff0ddae2dc2270afcc840799046f364828600d44ee
MD5 1777aeb2ddf4ff4717e6522da80d0e63
BLAKE2b-256 b6efea04e6ebefe56ac1f14998c664295c7c348dac482f463ef6e974635142d0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page