Skip to content

Commit

Permalink
Switch from setup.py to pyproject.toml.
Browse files Browse the repository at this point in the history
  • Loading branch information
mindflayer committed Jul 30, 2023
1 parent e0b085a commit d8391a2
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 116 deletions.
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,24 @@

install-dev-requirements:
pip install -U pip
pip install pipenv

install-test-requirements:
pipenv install --dev
pipenv run python -c "import pipfile; pf = pipfile.load('Pipfile'); print('\n'.join(package+version if version != '*' else package for package, version in pf.data['default'].items()))" > requirements.txt
pip install -e .[test]

services-up:
pipenv run docker-compose up -d
docker-compose up -d

services-down:
pipenv run docker-compose down --remove-orphans
docker-compose down --remove-orphans

test-python:
@echo "Running Python tests"
pipenv run wait-for-it --service httpbin.local:443 --service localhost:6379 --timeout 5 -- pipenv run python run_tests.py || exit 1
wait-for-it --service httpbin.local:443 --service localhost:6379 --timeout 5 -- python run_tests.py || exit 1
@echo ""

lint-python:
@echo "Linting Python files"
pipenv run flake8 --ignore=E501,E731,W503 --exclude=.git,compat.py --per-file-ignores='mocket/async_mocket.py:E999' mocket
flake8 --ignore=E501,E731,W503 --exclude=.git,compat.py --per-file-ignores='mocket/async_mocket.py:E999' mocket
@echo ""

setup: develop
Expand All @@ -35,9 +33,8 @@ safetest:
export SKIP_TRUE_REDIS=1; export SKIP_TRUE_HTTP=1; make test

publish: install-test-requirements
pipenv run python -m build --sdist .
pipenv run twine upload --repository mocket dist/mocket-$(shell python -c 'import mocket; print(mocket.__version__)').tar.gz
pipenv run anaconda upload dist/mocket-$(shell python -c 'import mocket; print(mocket.__version__)').tar.gz
python -m build --sdist .
twine upload --repository mocket dist/mocket-$(shell python -c 'import mocket; print(mocket.__version__)').tar.gz

clean:
rm -rf *.egg-info dist/ requirements.txt Pipfile.lock
Expand Down
37 changes: 0 additions & 37 deletions Pipfile

This file was deleted.

2 changes: 0 additions & 2 deletions mocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
from .mocket import Mocket, MocketEntry, Mocketizer, mocketize

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

__version__ = "3.11.1"
67 changes: 67 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
requires-python = ">=3.5"
name = "mocket"
description = "Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support"
version = "3.11.1"
readme = { file = "README.rst", content-type = "text/x-rst" }
license = { file = "LICENSE" }
authors = [{ name = "Giorgio Salluzzo", email = "[email protected]" }]
urls = { github = "https://github.com/mindflayer/python-mocket" }
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development",
"Topic :: Software Development :: Testing",
"License :: OSI Approved :: BSD License",
]
dependencies = [
"python-magic>=0.4.5",
"decorator>=4.0.0",
"urllib3>=1.25.3",
"httptools",
]

[project.optional-dependencies]
test = [
"pre-commit",
"pytest",
"pytest-cov",
"pytest-asyncio",
"asgiref",
"requests",
"redis",
"gevent",
"sure",
"pook",
"flake8",
"xxhash",
"aiohttp",
"httpx",
"pipfile",
"build",
"twine",
"fastapi",
"docker-compose",
"wait-for-it",
]
speedups = [
'xxhash;platform_python_implementation=="CPython"',
'xxhash-cffi;platform_python_implementation=="PyPy"',
]
pook = [
"pook>=0.2.1",
]
67 changes: 0 additions & 67 deletions setup.py

This file was deleted.

0 comments on commit d8391a2

Please sign in to comment.