diff --git a/.gitignore b/.gitignore index beb8128a..c1979df9 100644 --- a/.gitignore +++ b/.gitignore @@ -27,5 +27,6 @@ doc/build .coverage shippable .pytest_cache/ -Pipfile.lock .vscode/ +Pipfile.lock +requirements.txt diff --git a/Makefile b/Makefile index 70fda1e1..b43f1dc5 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,9 @@ install-dev-requirements: pip install pipenv==2020.6.2 - pipenv lock install-test-requirements: + pipenv lock -r > requirements.txt pipenv install --dev test-python: @@ -17,18 +17,16 @@ lint-python: flake8 --ignore=E501,E731,W503 --exclude=.git,compat.py --per-file-ignores='mocket/async_mocket.py:E999' mocket @echo "" -develop: install-dev-requirements install-test-requirements +develop: install-dev-requirements install-test-requirements test: lint-python test-python safetest: export SKIP_TRUE_REDIS=1; export SKIP_TRUE_HTTP=1; make test -publish: +publish: install-test-requirements python setup.py sdist - pipenv install --dev twine twine upload dist/mocket-$(shell python -c 'import mocket; print(mocket.__version__)')*.* - pipenv install --dev anaconda-client anaconda upload dist/mocket-$(shell python -c 'import mocket; print(mocket.__version__)').tar.gz clean: diff --git a/Pipfile b/Pipfile index f66291f2..88241c55 100644 --- a/Pipfile +++ b/Pipfile @@ -22,6 +22,8 @@ gevent = "*" sure = "*" pook = "*" flake8 = "*" +twine = "*" +anaconda-client = "*" [requires] python_version = "3.8" diff --git a/mocket/__init__.py b/mocket/__init__.py index 10526f08..c32d142b 100644 --- a/mocket/__init__.py +++ b/mocket/__init__.py @@ -7,4 +7,4 @@ __all__ = ("mocketize", "Mocket", "MocketEntry", "Mocketizer") -__version__ = "3.8.5" +__version__ = "3.8.6" diff --git a/runtests.py b/runtests.py index 6e794976..d8a4cb0b 100644 --- a/runtests.py +++ b/runtests.py @@ -21,7 +21,7 @@ def runtests(args=None): extras += ["aiohttp", "async_timeout"] - os.system("pipenv install --dev {}".format(" ".join(extras))) + os.system("pipenv run pip install {}".format(" ".join(extras))) if not any(a for a in args[1:] if not a.startswith("-")): args.append("tests/main") @@ -31,7 +31,7 @@ def runtests(args=None): args.append("tests/tests35") if major == 3 and minor >= 8: - args.append('tests/tests38') + args.append("tests/tests38") sys.exit(pytest.main(args)) diff --git a/setup.py b/setup.py index cb3367b5..458d3336 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ import io import os -import subprocess import sys from setuptools import find_packages, setup @@ -9,15 +8,13 @@ major, minor = sys.version_info[:2] - -def list_requirements(dev=False): - command = "pipenv lock -r" - if dev: - command += " --dev" - return ( - subprocess.check_output(command, shell=True).decode("ascii").split("\n")[1:-1] - ) - +install_requires = [ + line + for line in io.open( + os.path.join(os.path.dirname(__file__), "requirements.txt") + ).readlines() + if not line.startswith("-i") +] pook_requires = ("pook>=0.2.1",) exclude_packages = ("tests", "tests.*") @@ -41,14 +38,13 @@ def read_version(package): with gevent/asyncio/SSL support", long_description=io.open("README.rst", encoding="utf-8").read(), packages=find_packages(exclude=exclude_packages), - install_requires=list_requirements(), + install_requires=install_requires, setup_requires=["pipenv"], extras_require={ "speedups": [ 'xxhash;platform_python_implementation=="CPython"', 'xxhash-cffi;platform_python_implementation=="PyPy"', ], - "tests": list_requirements(dev=True), "dev": [], "pook": pook_requires, # plugins version supporting mocket.plugins.pook.MocketEngine },