Skip to content

Commit fb3c07b

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

File tree

6 files changed

+949
-951
lines changed

6 files changed

+949
-951
lines changed

.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.

0 commit comments

Comments
 (0)