Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ doc/build
.coverage
shippable
.pytest_cache/
Pipfile.lock
.vscode/
Pipfile.lock
requirements.txt
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ gevent = "*"
sure = "*"
pook = "*"
flake8 = "*"
twine = "*"
anaconda-client = "*"

[requires]
python_version = "3.8"
2 changes: 1 addition & 1 deletion mocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

__all__ = ("mocketize", "Mocket", "MocketEntry", "Mocketizer")

__version__ = "3.8.5"
__version__ = "3.8.6"
4 changes: 2 additions & 2 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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))

Expand Down
20 changes: 8 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import io
import os
import subprocess
import sys

from setuptools import find_packages, setup
Expand All @@ -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.*")
Expand All @@ -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
},
Expand Down