Skip to content

Commit e69071a

Browse files
authored
Switch from setup.py to pyproject.toml (#205)
* Switch from `setup.py` to `pyproject.toml`. * Switch build system to using Hatch. * Removing MANIFEST.in
1 parent e0b085a commit e69071a

File tree

6 files changed

+90
-123
lines changed

6 files changed

+90
-123
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-20.04
1919
strategy:
2020
matrix:
21-
python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', 'pypy3.9']
21+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy3.10']
2222

2323
steps:
2424
- uses: actions/checkout@v3
@@ -28,8 +28,7 @@ jobs:
2828
python-version: ${{ matrix.python-version }}
2929
cache: 'pip'
3030
cache-dependency-path: |
31-
Pipfile
32-
setup.py
31+
pyproject.toml
3332
- uses: isbang/compose-action@v1.4.1
3433
with:
3534
compose-file: "./docker-compose.yml"

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

Makefile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
#!/usr/bin/make -f
22

33
install-dev-requirements:
4-
pip install -U pip
5-
pip install pipenv
4+
pip install -U pip hatch
65

76
install-test-requirements:
8-
pipenv install --dev
9-
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
7+
pip install .[test]
108

119
services-up:
12-
pipenv run docker-compose up -d
10+
docker-compose up -d
1311

1412
services-down:
15-
pipenv run docker-compose down --remove-orphans
13+
docker-compose down --remove-orphans
1614

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

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

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

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

4239
clean:
4340
rm -rf *.egg-info dist/ requirements.txt Pipfile.lock

Pipfile

Lines changed: 0 additions & 37 deletions
This file was deleted.

pyproject.toml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
requires-python = ">=3.5"
7+
name = "mocket"
8+
description = "Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support"
9+
readme = { file = "README.rst", content-type = "text/x-rst" }
10+
license = { file = "LICENSE" }
11+
authors = [{ name = "Giorgio Salluzzo", email = "giorgio.salluzzo@gmail.com" }]
12+
urls = { github = "https://github.com/mindflayer/python-mocket" }
13+
classifiers = [
14+
"Development Status :: 6 - Mature",
15+
"Intended Audience :: Developers",
16+
"Operating System :: OS Independent",
17+
"Programming Language :: Python :: 3.7",
18+
"Programming Language :: Python :: 3.8",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: Implementation :: CPython",
23+
"Programming Language :: Python :: Implementation :: PyPy",
24+
"Topic :: Software Development",
25+
"Topic :: Software Development :: Testing",
26+
"License :: OSI Approved :: BSD License",
27+
]
28+
dependencies = [
29+
"python-magic>=0.4.5",
30+
"decorator>=4.0.0",
31+
"urllib3>=1.25.3",
32+
"httptools",
33+
]
34+
dynamic = ["version"]
35+
36+
[project.optional-dependencies]
37+
test = [
38+
"pre-commit",
39+
"pytest",
40+
"pytest-cov",
41+
"pytest-asyncio",
42+
"asgiref",
43+
"requests",
44+
"redis",
45+
"gevent",
46+
"sure",
47+
"pook",
48+
"flake8",
49+
"xxhash",
50+
"aiohttp",
51+
"httpx",
52+
"pipfile",
53+
"build",
54+
"twine",
55+
"fastapi",
56+
"wait-for-it",
57+
]
58+
speedups = [
59+
'xxhash;platform_python_implementation=="CPython"',
60+
'xxhash-cffi;platform_python_implementation=="PyPy"',
61+
]
62+
pook = [
63+
"pook>=0.2.1",
64+
]
65+
66+
[tool.hatch.version]
67+
path = "mocket/__init__.py"
68+
69+
[tool.hatch.build]
70+
ignore-vcs = true
71+
72+
[tool.hatch.build.targets.sdist]
73+
include = [
74+
"run_tests.py",
75+
"README.rst",
76+
"LICENSE",
77+
"pyproject.toml",
78+
"mocket/",
79+
"tests/",
80+
]

setup.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)