This GitHub Actions workflow automates two tasks:
1. **Create Release:**
- Triggered when a new version tag (formatted as `vX.X.X`) is pushed.
- Creates a release with the tag name, marking it as the latest version.
2. **Publish to PyPI:**
- Runs after the release is created successfully.
- Builds and publishes the Python package to PyPI using Poetry.
- Ignores development requirements during the publishing process.
This ensures that each new version gets a release on GitHub and the corresponding Python package is published on PyPI.
Co-authored-by: Darwish Ahmad Herati <13837531+daherati@users.noreply.github.com>
Co-authored-by: mateuslatrova <57113699+mateuslatrova@users.noreply.github.com>
**TL;DR: this post-commit hook ensures that valid versions are automatically tagged based on changes in the `pyproject.toml` file.**
This post-commit hook automates the tagging of the project based on changes in the `pyproject.toml` file. Here's a breakdown of what it does:
**1. Extracting the version number:**
* `git diff HEAD^..HEAD`: This line compares the current commit (`HEAD`) to its immediate predecessor (`HEAD^`).
* `-- "$(git rev-parse --show-toplevel)"/pyproject.toml`: This specifies the `pyproject.toml` file within the project root directory.
* `grep -m 1 '^\+.*version'`: This searches for the first line starting with a "+" and containing the word "version".
* `sed -s 's/[^A-Z0-9\.\-]//g'`: This removes any characters except numbers, letters, dots, and hyphens from the matched line.
* `version=`: Finally, the extracted version string is stored in the `version` variable.
**2. Validating the version format:**
* `if [[ ! $version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)(\-[A-Z]+\.[0-9]+)?$ ]]; then`: This checks if the extracted version string matches a specific format:
* `^`: Starts with the beginning of the string.
* `([0-9]+)`: Matches one or more digits (major version).
* `\.`: Matches a literal dot.
* `([0-9]+)`: Matches one or more digits (minor version).
* `\.`: Matches a literal dot.
* `([0-9]+)`: Matches one or more digits (patch version).
* `(\-[A-Z]+\.[0-9]+)?`: This is optional and matches a hyphen followed by one or more uppercase letters and a dot and another number (pre-release + build information).
* `$`: Matches the end of the string.
* If the format is invalid, it logs a message and exits with an error code.
**3. Creating the tag:**
* `git tag -a "v$version"`: This creates a new annotated tag named `v$version` (with the prefix "v") using the extracted version number.
* ``-m "`git log -1 --format=%s`"``: This sets the tag message with the full commit message of the current commit.
* `echo "Created a new tag, v$version"`: This prints a confirmation message.
Co-authored-by: Darwish Ahmad Herati <13837531+daherati@users.noreply.github.com>
- The pypy v7.3.13, used by GitHub Actions, was failing. So I force to use pypy v7.3.12 that was passing.
- The original PR was done by @EwoutH at #334 and modified by @willianrocha at #398.
A bit of CI maintenance:
- Add Python 3.10 and 3.11 runs, and update the PyPy run to PyPy 3.9
- Removed Python 3.7 as it is deprecated
- Update the used actions (checkout and setup-python) to the latest versions
- Also run on pushes, when manually triggered (workflow_dispatch)
The original PR was done by @EwoutH at #334
Originally mapped to gevent-socketio, which is outdated and hasn't been updated since 2016. Anyone importing socketio is much more likely to mean python-socketio now.
telegram is a hollow pypi package, so pipreqs will try to install that instead of python-telegram-bot, which have a module named telegram.
I'll ask to approve this change, as I'm blocked with my Pipedream workflow.
While trying to upload release 0.4.11 to pypi I got a few errors due to
the rst syntax of the readme. This commit fixes the errors but not the
warnings (mostly undeclared long format description type in setup.py)
This commit essentially adds back tests to our CI pipeline. They were
previously dropped due to Travis pricing policy change.
This workflow utilizes a few interesting projects to make this action
easier to maintain such as the codecov github action
and the tox-gh-actions project
(https://github.com/ymyzk/tox-gh-actions)
This commit uses codecov instead of coveralls because using coveralls
directly inside GH-actions is buggy and the official coveralls action
only supports lcov reports which we can't seem to be able to generate at
the moment. For more information see the pull request that introduced
this commit
Review dog is an incredible project that makes linting and formatting
review a breeze by commenting inline what is wrong in a pull request.
This makes the review process easier for the maintainer and also
provides a clearer feedback to the contributor