Skip to content

Commit

Permalink
pep517+518 build
Browse files Browse the repository at this point in the history
build packages based on metadata (pyproject.toml+setup.cfg).

barebone setup.py is needed for compability, e.g. `pip install -e`
  • Loading branch information
mgor committed Apr 11, 2022
1 parent 300b93e commit c06d4a6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.9-slim as base

FROM base as builder
RUN apt update && apt install -y git
RUN apt-get update && apt-get install -y git
# there are no wheels for some packages (geventhttpclient?) for arm64/aarch64, so we need some build dependencies there
RUN if [ -n "$(arch | grep 'arm64\|aarch64')" ]; then apt install -y --no-install-recommends gcc python3-dev; fi
RUN python -m venv /opt/venv
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
build-backend = "setuptools.build_meta"

[tool.black]
line-length = 120

[tool.setuptools_scm]
write_to = "locust/_version.py"
local_scheme = "no-local-version"
18 changes: 17 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description = Developer friendly load testing framework
long_description = file: README.md
long_description_content_type = text/markdown
license = MIT
obsoletes-dist = locustio
obsoletes_dist = locustio
classifiers =
Topic :: Software Development :: Testing :: Traffic Generation
Development Status :: 5 - Production/Stable
Expand All @@ -35,6 +35,22 @@ packages = find:
include_package_data = true
zip_safe = false
python_requires = >= 3.6
install_requires =
gevent >=20.12.1
flask >=2.0.0
Werkzeug >=2.0.0
requests >=2.23.0
msgpack >=0.6.2
pyzmq >=22.2.1
geventhttpclient >=1.5.1
ConfigArgParse >=1.0
psutil >=5.6.7
Flask-BasicAuth >=0.2.0
Flask-Cors >=3.0.10
roundrobin >=0.0.2
typing-extensions >=3.7.4.3
Jinja2 <3.1.0
pywin32;platform_system=='Windows'

[options.packages.find]
exclude =
Expand Down
44 changes: 3 additions & 41 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
import ast
import os
import re
import sys
# kept for compability, https://setuptools.pypa.io/en/latest/setuptools.html?highlight=setuptools.setup()#setup-cfg-only-projects
import setuptools

from setuptools import find_packages, setup

ROOT_PATH = os.path.abspath(os.path.dirname(__file__))

setup(
name="locust",
install_requires=[
"gevent>=20.12.1",
"flask>=2.0.0",
"Werkzeug>=2.0.0",
"requests>=2.23.0",
"msgpack>=0.6.2",
"pyzmq>=22.2.1",
"geventhttpclient>=1.5.1",
"ConfigArgParse>=1.0",
"psutil>=5.6.7",
"Flask-BasicAuth>=0.2.0",
"Flask-Cors>=3.0.10",
"roundrobin>=0.0.2",
"typing-extensions>=3.7.4.3",
"Jinja2<3.1.0",
],
test_suite="locust.test",
tests_require=[
"cryptography",
"mock",
"pyquery",
],
extras_require={
":sys_platform == 'win32'": ["pywin32"],
},
use_scm_version={
"write_to": "locust/_version.py",
"local_scheme": "no-local-version",
},
setup_requires=["setuptools_scm<=6.0.1"],
)
setuptools.setup()

0 comments on commit c06d4a6

Please sign in to comment.