This repository has been archived by the owner on Dec 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from MousaZeidBaker/poetryup
Add PoetryUp functionality
- Loading branch information
Showing
16 changed files
with
846 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# This workflow builds and publishes package distribution to PyPI | ||
|
||
name: Publish | ||
|
||
# controls when the action will run | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
publish_testpypi: | ||
runs-on: ubuntu-latest | ||
environment: testpypi | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install poetry 1.1.7 | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.1.7 | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Test | ||
run: | | ||
source $(poetry env info --path)/bin/activate # activate virtual environment | ||
pytest tests | ||
- name: Build | ||
run: poetry build | ||
|
||
- name: Publish testpypi | ||
env: | ||
POETRY_REPOSITORIES_TESTPYPI_URL: https://test.pypi.org/legacy/ | ||
POETRY_HTTP_BASIC_TESTPYPI_USERNAME: __token__ | ||
POETRY_HTTP_BASIC_TESTPYPI_PASSWORD: ${{secrets.TESTPYPI_API_TOKEN}} | ||
run: poetry publish -r testpypi | ||
|
||
publish_pypi: | ||
runs-on: ubuntu-latest | ||
environment: pypi | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install poetry 1.1.7 | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.1.7 | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Test | ||
run: | | ||
source $(poetry env info --path)/bin/activate # activate virtual environment | ||
pytest tests | ||
- name: Build | ||
run: poetry build | ||
|
||
- name: Publish pypi | ||
env: | ||
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__ | ||
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{secrets.PYPI_API_TOKEN}} | ||
run: poetry publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This workflow tests our package | ||
|
||
name: Test | ||
|
||
# controls when the action will run | ||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
publish_testpypi: | ||
runs-on: ubuntu-latest | ||
environment: testpypi | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install poetry 1.1.7 | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.1.7 | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Test | ||
run: | | ||
source $(poetry env info --path)/bin/activate # activate virtual environment | ||
pytest tests | ||
- name: Build | ||
run: poetry build | ||
|
||
- name: Publish testpypi dry-run | ||
env: | ||
POETRY_REPOSITORIES_TESTPYPI_URL: https://test.pypi.org/legacy/ | ||
POETRY_HTTP_BASIC_TESTPYPI_USERNAME: __token__ | ||
POETRY_HTTP_BASIC_TESTPYPI_PASSWORD: ${{secrets.TESTPYPI_API_TOKEN}} | ||
run: poetry publish -r testpypi --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# IntelliJ’s project specific settings files | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Mousa Zeid Baker | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,36 @@ | ||
# poetryup | ||
# PoetryUp | ||
|
||
![build](https://github.com/MousaZeidBaker/poetryup/workflows/Publish/badge.svg) | ||
![test](https://github.com/MousaZeidBaker/poetryup/workflows/Test/badge.svg) | ||
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) | ||
![python_version](https://img.shields.io/badge/python-%3E=3.6-blue.svg) | ||
[![pypi_v](https://img.shields.io/pypi/v/poetryup.svg)](https://pypi.org/project/poetryup) | ||
[![pypi_dm](https://img.shields.io/pypi/dm/poetryup.svg)](https://pypi.org/project/poetryup) | ||
|
||
PoetryUp updates dependencies and bumps their version in the `pyproject.toml` file with respect to their version | ||
constraint. The `poetry.lock` file will be recreated as well. PoetryUp runs | ||
[poetry](https://github.com/python-poetry/poetry) commands, thus it's required to be installed. The difference between | ||
running `poetry update` and `poetryup`, is that the latter also modifies the `pyproject.toml` file. | ||
|
||
## Usage | ||
```shell | ||
poetryup | ||
``` | ||
|
||
## Test | ||
Activate virtualenv & Install project dependencies | ||
```shell | ||
poetry shell && poetry install | ||
``` | ||
|
||
Run tests | ||
```shell | ||
pytest tests | ||
``` | ||
|
||
## Contributing | ||
Contributions are welcome via pull requests. | ||
|
||
## Issues | ||
If you encounter any problems, please file an [issue](https://github.com/MousaZeidBaker/poetryup/issues) along with a | ||
detailed description. |
Oops, something went wrong.