-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: convert from pip/tox to poetry
Instead of using tox to setup and control virtualenvs, use poetry to handle package definition, installation, and virtual environment setup. Signed-off-by: Mike Fiedler <miketheman@gmail.com>
- Loading branch information
1 parent
4a922b8
commit 0aee845
Showing
11 changed files
with
79 additions
and
118 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 |
---|---|---|
|
@@ -12,7 +12,6 @@ plugins: | |
exclude_patterns: | ||
- "*.egg-info/" | ||
- .cache/ | ||
- .tox/ | ||
- __pycache__/ | ||
- dist/ | ||
- htmlcov/ | ||
|
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,2 @@ | ||
[report] | ||
include = *pytest_socket* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,3 +72,6 @@ target/ | |
.python-version | ||
|
||
.pytest_cache/ | ||
|
||
# poetry lock file - for libraries only | ||
poetry.lock |
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 |
---|---|---|
@@ -1,25 +1,29 @@ | ||
.PHONY: all clean test | ||
.PHONY: all clean poetry test dist testrelease release | ||
|
||
TOX := $(shell command -v tox 2> /dev/null) | ||
POETRY := $(shell command -v poetry 2> /dev/null) | ||
|
||
all: test | ||
|
||
clean: | ||
@find . -name \*.pyc -name __pycache__ -delete | ||
@rm -fr .cache/ .coverage* .pytest_cache/ .tox/ *.egg-info/ dist/ htmlcov/ | ||
@find . -name \*.pyc -delete | ||
@find . -name __pycache__ -delete | ||
@rm -fr .cache/ .coverage .pytest_cache/ *.egg-info/ dist/ htmlcov/ | ||
|
||
test: | ||
ifndef TOX | ||
$(error "tox is not available, run `pip install tox`") | ||
poetry.lock pytest_socket.egg-info/ : | ||
ifndef POETRY | ||
$(error "poetry is not available, please install it first.") | ||
endif | ||
@tox | ||
@poetry install | ||
|
||
build: clean | ||
@python setup.py sdist | ||
test: pytest_socket.egg-info/ | ||
@poetry run pytest | ||
|
||
testrelease: build | ||
dist: clean poetry.lock | ||
@poetry build | ||
|
||
testrelease: dist | ||
# Requires a `[pypitest]` section in ~/.pypirc | ||
@twine upload -r pypitest dist/* | ||
|
||
release: build | ||
release: dist | ||
@twine upload dist/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[tool.poetry] | ||
name = "pytest-socket" | ||
version = "0.3.3" | ||
description = "Pytest Plugin to disable socket calls during tests" | ||
authors = ["Mike Fiedler <miketheman@gmail.com>"] | ||
license = "MIT" | ||
readme = "README.rst" | ||
homepage = "https://pypi.org/project/pytest-socket/" | ||
repository = "https://github.com/miketheman/pytest-socket" | ||
include = [ | ||
"LICENSE", | ||
"README.rst", | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Framework :: Pytest", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Testing", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Operating System :: OS Independent", | ||
"License :: OSI Approved :: MIT License", | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.5" | ||
pytest = ">=3.6.3" | ||
|
||
[tool.poetry.dev-dependencies] | ||
pytest = "^5.4" | ||
pytest-cov = "^2.8.1" | ||
pytest-httpbin = "^1.0" | ||
|
||
[tool.poetry.plugins.pytest11] | ||
socket = 'pytest_socket' | ||
|
||
[tool.poetry.urls] | ||
"Bug Tracker" = "https://github.com/miketheman/pytest-socket/issues" | ||
|
||
[build-system] | ||
requires = ["poetry>=0.12"] | ||
build-backend = "poetry.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[pytest] | ||
addopts = | ||
--cov | ||
--cov-report=term |