Skip to content

Commit 18d86b4

Browse files
authored
Updated manifest, requirements and version handling process (#47)
1 parent 5e7ce92 commit 18d86b4

File tree

4 files changed

+22
-20
lines changed

4 files changed

+22
-20
lines changed

MANIFEST.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ exclude .svn
4141
exclude .hg
4242
exclude appointment/__pycache__
4343
exclude appointment/migrations/__pycache__
44-
exclude appointment/django_appointment.egg-info/PKG-INFO
45-
exclude appointment/django_appointment.egg-info/SOURCES.txt
46-
exclude appointment/django_appointment.egg-info/dependency_links.txt
47-
exclude appointment/django_appointment.egg-info/requires.txt
48-
exclude appointment/django_appointment.egg-info/top_level.txt
4944

5045
# Recursive exclusions
5146
recursive-exclude appointment/migrations *.py

appointment/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
__description__ = "Managing appointment scheduling with customizable slots, staff features, and conflict handling."
55
__package_name__ = "django-appointment"
66
__url__ = "https://github.com/adamspd/django-appointment"
7-
__version__ = "2.1.1"
7+
__version__ = "2.1.2"
8+
__test_version__ = True

check_version.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
import requests
2-
from appointment import __version__, __package_name__
2+
from appointment import __version__, __package_name__, __test_version__
33

4-
package_name = __package_name__
5-
current_version = __version__
64

7-
response = requests.get(f"https://pypi.org/pypi/{package_name}/json")
5+
def check_package_version(package_name, current_version):
6+
version_exists = False
87

9-
version_exists = False
10-
11-
if response.status_code == 200:
12-
released_versions = response.json()["releases"].keys()
13-
if current_version in released_versions:
14-
print(f"Version {current_version} already exists on PyPI!")
8+
if __test_version__:
9+
print("Test version, skipping PyPI check.")
1510
version_exists = True
11+
else:
12+
response = requests.get(f"https://pypi.org/pypi/{package_name}/json")
13+
14+
if response.status_code == 200:
15+
released_versions = response.json()["releases"].keys()
16+
if current_version in released_versions:
17+
print(f"Version {current_version} already exists on PyPI!")
18+
version_exists = True
19+
20+
# Output for GitHub Actions
21+
print(f"::set-output name=version_exists::{version_exists}")
22+
1623

17-
# Output for GitHub Actions
18-
print(f"::set-output name=version_exists::{version_exists}")
24+
check_package_version(__package_name__, __version__)

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Django==5.0
1+
Django==4.2.8
22
Pillow==10.1.0
33
phonenumbers==8.13.26
44
django-phonenumber-field==7.2.0
5-
babel==2.13.1
5+
babel==2.14.0
66
setuptools==69.0.2
77
pytz~=2023.3.post1

0 commit comments

Comments
 (0)