Skip to content

Commit 8c64153

Browse files
committed
poetry: Switch from using pipenv to poetry
Fixes: 32
1 parent c0c91ec commit 8c64153

File tree

8 files changed

+962
-964
lines changed

8 files changed

+962
-964
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ jobs:
1818
with:
1919
python-version: 3.9
2020

21+
- name: Install poetry
22+
uses: abatilo/actions-poetry@v2
23+
with:
24+
poetry-version: "1.7.1"
25+
2126
- name: Install dependencies
2227
run: |
23-
python -m pip install --upgrade pip
24-
pip install pipenv
25-
pipenv install --dev
28+
poetry install
2629
2730
- name: Run linters
2831
run: |
29-
pipenv run mypy ./src
32+
make lint
3033
3134
- name: Run tests
3235
run: |
33-
pipenv run python setup.py install
34-
pipenv run pytest
36+
make test

.github/workflows/upload.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@ jobs:
1212
- name: Checkout Git
1313
uses: actions/checkout@v2
1414

15-
- name: Install Python 3
16-
uses: actions/setup-python@v2
15+
- name: Install poetry
16+
uses: abatilo/actions-poetry@v2
1717
with:
18-
python-version: 3.9
18+
poetry-version: "1.7.1"
1919

2020
- name: Install dependencies
2121
run: |
22-
python -m pip install --upgrade pip
23-
pip install pipenv
24-
pipenv install --dev
22+
poetry install
2523
2624
- name: Build package
2725
run: |
28-
pipenv run python -m build --no-isolation
26+
make build
2927
3028
- name: Publish package
3129
if: startsWith(github.ref, 'refs/tags')

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,6 @@ cython_debug/
131131
# VS Code
132132
.history
133133
.vscode
134+
135+
#pyenv
136+
.python-version

Makefile

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
11
.DEFAULT_GOAL := help
22
.PHONY: help build test
33

4+
PYPI_TOKEN := $(shell echo ${PYPI_TOKEN})
5+
PYPI_TEST_TOKEN := $(shell echo ${PYPI_TEST_TOKEN})
6+
7+
48
build: ## Build an application
5-
@pipenv run python -m build --no-isolation
9+
@poetry build
10+
11+
configure_pypi_publishing: ## Configure publishing to PyPI
12+
@if [ -z "${PYPI_TOKEN}" ] ; then echo "you need to export PYPI_TOKEN before running this command" ; false ; fi
13+
@if [ -z "${PYPI_TOKEN}" ] ; then echo "you need to export PYPI_TEST_TOKEN before running this command" ; false ; fi
14+
@poetry config repositories.test-pypi https://test.pypi.org/legacy/
15+
@poetry config pypi-token.test-pypi $(PYPI_TEST_TOKEN)
16+
@poetry config pypi-token.pypi $(PYPI_TOKEN)
617

718
publish-test: ## Upload package to test PyPI
8-
@pipenv run twine upload --repository testpypi dist/*
19+
@poetry publish -r test-pypi
920

1021
publish: build ## Upload package to PyPI
11-
@pipenv run twine upload dist/*
22+
@poetry publish
1223
@make clean
1324

14-
install: build ## Install application to Pip environment
15-
@pipenv run python -m pip install
16-
17-
install-dev: ## Install application to Pip development environment
18-
@pipenv run python -m pip install -e
19-
@make clean
25+
install: build ## Install application to Poetry environment
26+
@poetry install
2027

2128
clean: ## Remove build files
2229
@rm -Rf build/ dist/ *.egg-info .pytest_cache/ .mypy_cache/ .pytype/ .eggs/ src/*.egg-info
2330
@echo "Temporary files were clear"
2431

2532
test: ## Run code tests
26-
@pipenv run python -m pytest -q
27-
28-
sync: ## Sync with Pipfile packages list
29-
@pipenv sync
33+
@poetry run pytest
3034

3135
lint: ## Run code linters
3236
@echo "Run code linters..."
33-
@pipenv run mypy ./src
37+
@poetry run mypy ./src
3438

3539
help: ## Show this message
3640
@echo "Application management"
3741
@echo
38-
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
42+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

Pipfile

Lines changed: 0 additions & 18 deletions
This file was deleted.

Pipfile.lock

Lines changed: 0 additions & 918 deletions
This file was deleted.

poetry.lock

Lines changed: 894 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[tool.poetry]
2+
name = "openapi3-parser"
3+
version = "1.1.16"
4+
description = "OpenAPI 3 parser to use a specification inside of the code in your projects"
5+
authors = ["Artem Manchenkov <[email protected]>"]
6+
license = "MIT"
7+
readme = "README.md"
8+
packages = [{ include = "openapi_parser", from = "src" }]
9+
10+
[tool.poetry.dependencies]
11+
python = "^3.9"
12+
prance = ">=0.20.2"
13+
openapi-spec-validator = "==0.6.0"
14+
15+
16+
[tool.poetry.group.dev.dependencies]
17+
wheel = ">=0.35.1"
18+
mypy = ">=0.800"
19+
pytest = ">=6.2.2"
20+
build = "*"
21+
22+
[build-system]
23+
requires = ["poetry-core"]
24+
build-backend = "poetry.core.masonry.api"
25+
26+
27+
[tool.pytest.ini_options]
28+
testpaths = [
29+
"tests",
30+
]
31+
pythonpath = [
32+
"./src"
33+
]

0 commit comments

Comments
 (0)