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

Create package releases for each version and publish them to PyPI #5

Open
Hedda opened this issue Mar 4, 2024 · 6 comments
Open

Create package releases for each version and publish them to PyPI #5

Hedda opened this issue Mar 4, 2024 · 6 comments

Comments

@Hedda
Copy link
Contributor

Hedda commented Mar 4, 2024

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:

Example:

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:

zigpy/zigpy-cli#45 (comment)

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

#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:

zigpy/zigpy-cli#42 (comment)

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
Copy link
Contributor Author

Hedda commented Mar 4, 2024

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/

@lhespress
Copy link
Owner

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

@lhespress
Copy link
Owner

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

@Hedda
Copy link
Contributor Author

Hedda commented Mar 15, 2024

@lhespress Nice! Please also update to 0.0.1 and post information in your pull request for zigpy-cli -> zigpy/zigpy-cli#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
Copy link
Contributor Author

Hedda commented Mar 15, 2024

@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

@lhespress
Copy link
Owner

@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.

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

No branches or pull requests

2 participants