Skip to content

Commit

Permalink
Use setuptools_scm for versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Jun 15, 2022
1 parent 7d12d01 commit c2485be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build
dist
.mypy_cache
.tox
_version.py
2 changes: 1 addition & 1 deletion bin/swarm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ parser.add_argument(
"--extra-files",
nargs="+",
default=[],
help="A list of extra files or directories to upload. Space-separated, e.g. --extra-files testdata.csv common.py my-directory/",
help="A list of extra files or directories to upload. Space-separated, e.g. --extra-files testdata.csv *.py my-directory/",
)
parser.add_argument( # secret parameter to optimize by not uploading locust-plugins every time
"--skip-plugins",
Expand Down
20 changes: 11 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import re
import os
import sys

Expand All @@ -10,11 +8,6 @@
from setuptools.command.egg_info import egg_info
from setuptools.command.develop import develop

_version_re = re.compile(r"__version__\s+=\s+(.*)")
_init_file = "locust_swarm/__init__.py"
with open(_init_file, "rb") as f:
version = str(ast.literal_eval(_version_re.search(f.read().decode("utf-8")).group(1)))


class PostDevelopCommand(develop):
def run(self):
Expand All @@ -39,7 +32,6 @@ def run(self):

setup(
name="locust-swarm",
version=version,
description="Load test + test data distribution & launching tool for Locust",
long_description="""https://github.com/SvenskaSpel/locust-swarm""",
classifiers=[
Expand All @@ -63,7 +55,17 @@ def run(self):
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=["keyring==21.4.0", "locust-plugins>=2.2.2", "psutil", "ConfigArgParse>=1.0"],
install_requires=[
"keyring==21.4.0",
"locust-plugins>=2.2.2",
"psutil",
"ConfigArgParse>=1.0",
],
scripts=["bin/swarm"],
cmdclass={"egg_info": PostEggInfoCommand, "install": PostInstallCommand, "develop": PostDevelopCommand},
use_scm_version={
"write_to": "locust_swarm/_version.py",
"local_scheme": "no-local-version",
},
setup_requires=["setuptools_scm"],
)

0 comments on commit c2485be

Please sign in to comment.