Skip to content

Commit f6891a2

Browse files
committed
Try to prevent the {{VERSION_PLACEHOLDER}} breaking tests
1 parent a75d829 commit f6891a2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

setup.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
from setuptools import find_packages, setup
33
import os
4+
import re
45

56
PACKAGES = find_packages()
67
REQUIREMENTS = ["django >=3.2,<5.3"]
@@ -15,10 +16,6 @@
1516
"Programming Language :: Python",
1617
"Programming Language :: Python :: 3",
1718
"Programming Language :: Python :: 3 :: Only",
18-
"Programming Language :: Python :: 3.4",
19-
"Programming Language :: Python :: 3.5",
20-
"Programming Language :: Python :: 3.6",
21-
"Programming Language :: Python :: 3.7",
2219
"Programming Language :: Python :: 3.8",
2320
"Programming Language :: Python :: 3.9",
2421
"Programming Language :: Python :: 3.10",
@@ -31,9 +28,14 @@
3128
)
3229
LONG_DESCRIPTION = open(os.path.join(os.path.dirname(__file__), "README.md")).read()
3330

31+
VERSION = "{{VERSION_PLACEHOLDER}}"
32+
if not re.match(r"^\d+\.\d+\.\d+$", VERSION):
33+
# In tests, where we haven't replaced the version placeholder, just use a default version
34+
VERSION = "1.0.0"
35+
3436
setup(
3537
name="django-csp-reports",
36-
version="{{VERSION_PLACEHOLDER}}",
38+
version=VERSION,
3739
description=DESCRIPTION,
3840
long_description=LONG_DESCRIPTION,
3941
long_description_content_type="text/markdown",
@@ -42,7 +44,7 @@
4244
url="https://github.com/adamalton/django-csp-reports",
4345
packages=PACKAGES,
4446
include_package_data=True,
45-
python_requires=">=3.4",
47+
python_requires=">=3.8",
4648
install_requires=REQUIREMENTS,
4749
tests_require=TEST_REQUIREMENTS,
4850
extras_require=EXTRAS_REQUIRE,

0 commit comments

Comments
 (0)