zigpy-espzb icon indicating copy to clipboard operation
zigpy-espzb copied to clipboard

Create package releases for each version and publish them to PyPI

Open Hedda opened this issue 1 year ago • 6 comments

Please tag version here in this GitHub repository after new commits/change + also package and push a matching release for each tagged version of zigpy-espzb to publish them to PyPI:

  • https://pypi.org/project/zigpy-espzb/
    • https://pypi.org/project/zigpy-espzb/#history
      • https://pypi.org/project/zigpy-espzb/#files

Example:

  • https://pypi.org/project/zigpy-znp/
    • https://pypi.org/project/zigpy-znp/#history
      • https://pypi.org/project/zigpy-znp/#files

References:

https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

https://github.com/marketplace/actions/pypi-publish

zigpy-cli require that all of its dependencies be installable. Otherwise, zigpy-cli can not be installed itself, see comment by puddly:

https://github.com/zigpy/zigpy-cli/issues/45#issuecomment-1927300507

Also see the related comment by puddly noting that CI is currently failing because zigpy-espzb package is not yet on PyPI:

https://github.com/lhespress/zigpy-espzb/pull/1

PS: You can initially create a PyPi project with either a Espressif account or a personal account and then later transfer it to zigpy admins:

https://github.com/zigpy/zigpy-cli/issues/42#issuecomment-1874925536

You can also create the project within the Espressif organization or a personal account and then transfer it.

zigpy-cli requires all of its dependencies be installable. Otherwise, zigpy-cli can't be installed itself. Let me know once you've published the radio library to PyPI and I can test it out or help get it running.

Hedda avatar Mar 04 '24 09:03 Hedda

Tip is to add TestPyPI (publish-to-testpypi.yml) workflow for testing publish distributions via TestPyPI to PyPi without actually doing so to the project there:

https://packaging.python.org/en/latest/guides/using-testpypi/

https://github.com/marketplace/actions/pypi-publish#advanced-release-management

https://github.com/pypa/packaging.python.org/blob/main/source/guides/github-actions-ci-cd-sample/publish-to-test-pypi.yml

Example check out that it is used in the similar zigpy-zboss project:

https://github.com/kardia-as/zigpy-zboss/blob/main/.github/workflows/publish-to-testpypi.yml

name: Publish distributions to TestPyPI
on:
  push:
    tags:
      - "*"

jobs:
  build-and-publish:
    name: Build and publish distributions to TestPyPI
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Set up Python 3.8
      uses: actions/setup-python@v4
      with:
        python-version: 3.8
    - name: Install wheel
      run: >-
        pip install wheel build
    - name: Build wheel
      run: >-
        python3 -m build
    - name: Publish distribution to Test PyPI
      uses: pypa/gh-action-pypi-publish@release/v1
      with:
        password: ${{ secrets.TEST_PYPI_API_TOKEN }}
        repository-url: https://test.pypi.org/legacy/

Hedda avatar Mar 04 '24 09:03 Hedda

@Hedda Thanks for your suggestion, we'll create a PyPi project ASAP.

lhespress avatar Mar 11 '24 01:03 lhespress

@Hedda I have published zigpy-espzb to PyPI, please check, thanks.

lhespress avatar Mar 15 '24 10:03 lhespress

@lhespress Nice! Please also update to 0.0.1 and post information in your pull request for zigpy-cli -> https://github.com/zigpy/zigpy-cli/pull/45

That is, update pyproject.toml for zigpy-cli to have "zigpy-espzb>=0.0.1" under dependencies:

https://github.com/zigpy/zigpy-cli/blob/dev/pyproject.toml

dependencies = [
    "click",
    "coloredlogs",
    "scapy",
    "zigpy>=0.55.0",
    "bellows>=0.35.1",
    "zigpy-deconz>=0.21.0",
    "zigpy-xbee>=0.18.0",
    "zigpy-zboss>=1.1.0",
    "zigpy-zigate>=0.11.0",
    "zigpy-znp>=0.11.1"
     "zigpy-espzb>=0.0.1"
]

Hedda avatar Mar 15 '24 12:03 Hedda

@lhespress you also need to tag 0.0.1 and make a matching release here on GitHub as well:

https://docs.github.com/en/repositories/releasing-projects-on-github

https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases

https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository

After that they should appear here:

https://github.com/lhespress/zigpy-espzb/tags

https://github.com/lhespress/zigpy-espzb/releases

For reference see and compare with tags and releases for the zigpy-znp repository on GitHub (which also include changelog):

https://github.com/zigpy/zigpy-znp/tags

https://github.com/zigpy/zigpy-znp/releases

PS: Tips is to also include automatically generated release notes which usually include included pull requests and changelog:

https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes

Hedda avatar Mar 15 '24 13:03 Hedda

@Hedda tag v0.0.1 and make a matching release:

https://github.com/lhespress/zigpy-espzb/tags

https://github.com/lhespress/zigpy-espzb/releases

please check, thanks.

lhespress avatar Mar 18 '24 03:03 lhespress