-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate from pipenv to poetry
- Loading branch information
Showing
15 changed files
with
2,081 additions
and
1,692 deletions.
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,36 @@ | ||
name: Safety | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
- "stable" | ||
pull_request: | ||
branches: | ||
- "master" | ||
- "stable" | ||
|
||
jobs: | ||
safety: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
poetry-version: [1.5] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Set up Poetry | ||
run: pip install poetry~=1.5 | ||
- name: Set up Safety | ||
run: pip install safety | ||
- name: Export requirements.txt | ||
run: poetry export --with dev -f requirements.txt --output requirements.txt | ||
- name: Run safety | ||
run: safety check -r requirements.txt |
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 |
---|---|---|
|
@@ -17,7 +17,6 @@ jobs: | |
matrix: | ||
python-version: [3.9] | ||
env: | ||
PIPENV_CHECK: "1" | ||
PGPORT: "5433" | ||
steps: | ||
- name: Checkout | ||
|
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
This file was deleted.
Oops, something went wrong.
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,3 +1,52 @@ | ||
[tool.semantic_release] | ||
version_variables = ["vmaas/common/constants.py:VMAAS_VERSION"] | ||
version_toml = ["pyproject.toml:tool.poetry.version"] | ||
commit_author = "vmaas-bot <[email protected]>" | ||
|
||
[tool.poetry] | ||
name = "vmaas" | ||
version = "2.50.3" | ||
description = "" | ||
authors = [""] | ||
readme = "README.md" | ||
packages = [] | ||
|
||
[tool.poetry.dependencies] | ||
python = "~3.9" | ||
aiohttp = ">=3.8.0" | ||
aiohttp-jinja2 = ">=1.5" | ||
app-common-python = ">=0.2.5" | ||
boto3 = ">=1.16.13" | ||
botocore = ">=1.19.13" | ||
click = ">=0.7" | ||
connexion = {extras = ["swagger-ui"],version = "2.14.1"} | ||
flask = "2.2.5" | ||
gitpython = ">=3.1.30" | ||
iso8601 = ">=0.1.12" | ||
jsonschema = ">=3.2.0" | ||
natsort = ">=7.0.1" | ||
psycopg2-binary = ">=2.8.6" | ||
prometheus-client = ">=0.8.0" | ||
pyopenssl = ">=19.1.0" | ||
python-dateutil = ">=2.8.1" | ||
pytz = ">=2020.4" | ||
pyyaml = ">=5.4.1" | ||
requests = ">=2.31.0" | ||
schema = ">=0.7.3" | ||
tornado = ">=6.0.3" | ||
watchtower = ">=1.0.0" | ||
werkzeug = ">=1.0.1" | ||
yarl = ">=1.6.2" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
coverage = ">=4.5.3" | ||
pur = ">=5.4.1" | ||
pytest = ">=5.0.1" | ||
pylint = ">=2.3.1" | ||
pytest-cov = ">=2.7.1" | ||
pytest-flask = ">=1.1.0" | ||
testing-postgresql = ">=1.3.0" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
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
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
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
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Script to lock Poetry dependencies in container and copy generated lock file back | ||
|
||
workdir="/tmp/" | ||
dockerfile="Dockerfile-poetry" | ||
|
||
for runtime in podman docker; do | ||
cmd=$(command -v $runtime) | ||
if [[ "$cmd" != "" ]] && $cmd ps &> /dev/null; then | ||
break | ||
else | ||
echo "Unable to use $runtime" | ||
cmd="" | ||
fi | ||
done | ||
|
||
if [[ "$cmd" != "" ]]; then | ||
echo "Using: $cmd" | ||
else | ||
echo "No container runtime found!" | ||
exit 1 | ||
fi | ||
|
||
cat <<EOF > $workdir$dockerfile | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal | ||
RUN microdnf install --setopt=install_weak_deps=0 --setopt=tsflags=nodocs \ | ||
python39 python39-pip python39-devel libpq-devel gcc git && \ | ||
microdnf clean all | ||
RUN pip3 install --upgrade pip && pip3 install --upgrade poetry~=1.5 | ||
EOF | ||
|
||
current_dir=$(pwd) | ||
cd $workdir | ||
$cmd build -t poetry-locker -f $dockerfile . | ||
cd $current_dir | ||
$cmd run --rm -d --name poetry-locker-container poetry-locker sleep infinity | ||
|
||
$cmd exec poetry-locker-container bash -c "mkdir -p /tmp" | ||
$cmd cp "pyproject.toml" poetry-locker-container:"/tmp/" | ||
$cmd exec poetry-locker-container bash -c "cd /tmp && poetry lock" | ||
$cmd cp poetry-locker-container:"/tmp/poetry.lock" "." | ||
|
||
$cmd kill poetry-locker-container |