https://github.com/rizerphe/poetry-python-downgrader-action
A github action for poetry-python-downgrader - a tool to downgrade poetry packages for compatibility with specific Python versions.
https://github.com/rizerphe/poetry-python-downgrader-action
Last synced: 3 months ago
JSON representation
A github action for poetry-python-downgrader - a tool to downgrade poetry packages for compatibility with specific Python versions.
- Host: GitHub
- URL: https://github.com/rizerphe/poetry-python-downgrader-action
- Owner: rizerphe
- License: mit
- Created: 2024-07-05T20:53:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-01T11:26:22.000Z (almost 2 years ago)
- Last Synced: 2025-03-05T12:34:08.832Z (over 1 year ago)
- Language: Dockerfile
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Poetry Python Downgrader
This is a github action for [poetry-python-downgrader](https://github.com/rizerphe/poetry-python-downgrader).
[](https://github.com/marketplace/actions/poetry-python-downgrader)
[](https://github.com/rizerphe/poetry-python-downgrader)
[](https://github.com/rizerphe/poetry-python-downgrader-action/releases)
[](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/py/poetry-python-downgrader)
## Quickstart
```yaml
- name: Downgrade Poetry packages
uses: rizerphe/poetry-python-downgrader-action@v0.1.6
with:
python-version: "3.8"
```
This action will modify `pyproject.toml` in place, making sure it is compatible with Python 3.8.
## Usage
You can use this tool as a GitHub Action in your workflows. Here's an example of how to use it:
```yaml
- name: Downgrade Poetry packages
uses: rizerphe/poetry-python-downgrader-action@v0.1.6
with:
python-version: "3.8"
pyproject-path: "pyproject.toml"
pin-versions: "false"
repository: "https://pypi.org/pypi"
```
**Action inputs:**
- `pyproject-path` (defaults to `pyproject.toml`): The path to the `pyproject.toml` file.
- `python-version` (defaults to "3.6"): The target Python version to downgrade the dependencies for.
- `pin-versions` (defaults to "false"): Set to "true" to pin package versions exactly instead of using caret ranges.
- `repository` (optional, defaults to "https://pypi.org/pypi"): The PyPI repository URL to use for querying package information.
### Examples
**Basic usage (downgrade to Python 3.8)**
```yaml
- uses: rizerphe/poetry-python-downgrader-action@v0.1.6
with:
python-version: "3.8"
```
**Use in a version matrix**
```yaml
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "pypy3.10"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: rizerphe/poetry-python-downgrader-action@v0.1.6
with:
python-version: ${{ matrix.python-version }}
```
This action does not support all github actions python versions; it'll just skip the downgrade if it doesn't know how to handle the version.
**Downgrade with pinned versions**
```yaml
- uses: rizerphe/poetry-python-downgrader-action@v0.1.6
with:
python-version: "3.8"
pin-versions: "true"
```
**Use a custom PyPI repository**
```yaml
- uses: rizerphe/poetry-python-downgrader-action@v0.1.6
with:
python-version: "3.8"
repository: "https://custom-pypi.example.com/pypi"
```
**Specify a different pyproject.toml location**
```yaml
- uses: rizerphe/poetry-python-downgrader-action@v0.1.6
with:
python-version: "3.8"
pyproject-path: "path/to/pyproject.toml"
```