python-flask-dev 0.0.9__tar.gz → 0.0.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/PKG-INFO +1 -3
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/pyproject.toml +16 -15
- python_flask_dev-0.0.11/src/python_flask_dev/packaging/__init__.py +0 -0
- python_flask_dev-0.0.11/src/python_flask_dev/packaging/incremental_versioning.py +113 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev.egg-info/PKG-INFO +1 -3
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev.egg-info/SOURCES.txt +3 -1
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/README.md +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/setup.cfg +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/__init__.py +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/app.py +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/data/__init__.py +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev/__init__.py +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev/custom_exceptions.py +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev/data_source.py +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev/filtering_data.py +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev/formatting_data.py +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev/importing_modules.py +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev/path_retrieval.py +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev.egg-info/dependency_links.txt +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev.egg-info/requires.txt +0 -0
- {python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev.egg-info/top_level.txt +0 -0
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-flask-dev
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.11
|
|
4
4
|
Summary: Package containing modules with 'helper' functions to support the development of Python Flask applications.
|
|
5
5
|
Author-email: Dani <daniasestan@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/pypa/sampleproject
|
|
8
|
-
Project-URL: Issues, https://github.com/pypa/sampleproject/issues
|
|
9
7
|
Classifier: Programming Language :: Python :: 3
|
|
10
8
|
Classifier: Operating System :: POSIX :: Linux
|
|
11
9
|
Classifier: Framework :: Flask
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-flask-dev"
|
|
3
|
-
version = "0.0.9"
|
|
4
3
|
authors = [
|
|
5
|
-
{ name="Dani", email="daniasestan@gmail.com" },
|
|
4
|
+
{ name = "Dani", email = "daniasestan@gmail.com" },
|
|
6
5
|
]
|
|
7
6
|
description = "Package containing modules with 'helper' functions to support the development of Python Flask applications."
|
|
8
7
|
readme = "README.md"
|
|
@@ -10,25 +9,27 @@ requires-python = ">=3.12.3"
|
|
|
10
9
|
classifiers = [
|
|
11
10
|
"Programming Language :: Python :: 3",
|
|
12
11
|
"Operating System :: POSIX :: Linux",
|
|
13
|
-
"Framework :: Flask"
|
|
12
|
+
"Framework :: Flask",
|
|
14
13
|
]
|
|
15
14
|
license = "MIT"
|
|
16
|
-
license-files = [
|
|
15
|
+
license-files = [
|
|
16
|
+
"LICEN[CS]E*",
|
|
17
|
+
]
|
|
17
18
|
dependencies = [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
"Flask==3.1.2",
|
|
20
|
+
"numpy==2.4.2",
|
|
21
|
+
"pandas==3.0.1",
|
|
21
22
|
"build==1.4.0",
|
|
22
|
-
"twine==6.2.0"
|
|
23
|
+
"twine==6.2.0",
|
|
23
24
|
]
|
|
25
|
+
version = "0.0.11"
|
|
26
|
+
dynamic = []
|
|
24
27
|
|
|
25
28
|
[build-system]
|
|
26
|
-
requires = [
|
|
29
|
+
requires = [
|
|
30
|
+
"setuptools >= 77.0.3",
|
|
31
|
+
]
|
|
27
32
|
build-backend = "setuptools.build_meta"
|
|
28
33
|
|
|
29
|
-
[tool.setuptools]
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
[project.urls]
|
|
33
|
-
Homepage = "https://github.com/pypa/sampleproject"
|
|
34
|
-
Issues = "https://github.com/pypa/sampleproject/issues"
|
|
34
|
+
[tool.setuptools.package-dir]
|
|
35
|
+
"" = "src"
|
|
File without changes
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import requests
|
|
3
|
+
import tomllib
|
|
4
|
+
import tomli_w
|
|
5
|
+
import argparse
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# ENV VARS
|
|
9
|
+
PYPI_BASE_URL = "https://pypi.org/simple/"
|
|
10
|
+
# VERSIONING = "foo_bar_baz"
|
|
11
|
+
VERSIONING = "manual"
|
|
12
|
+
# VERSIONING = "dynamic"
|
|
13
|
+
# VERSIONING = "automatic"
|
|
14
|
+
|
|
15
|
+
# # ARGS
|
|
16
|
+
# parser = argparse.ArgumentParser()
|
|
17
|
+
# parser.add_argument('-v', '--versioning', default="manual", help='Options: "automatic", "dynamic", "manual"')
|
|
18
|
+
# args = parser.parse_args()
|
|
19
|
+
|
|
20
|
+
# LOGGING
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
22
|
+
logging.basicConfig(level=logging.INFO)
|
|
23
|
+
|
|
24
|
+
def get_pypi_repository_data(toml_data):
|
|
25
|
+
# Retrieve latest version from PyPI API data
|
|
26
|
+
project_name = toml_data["project"]["name"]
|
|
27
|
+
pypi_project_url = f"{PYPI_BASE_URL}{project_name}"
|
|
28
|
+
resp = requests.get(pypi_project_url, headers={"Accept": "application/vnd.pypi.simple.v1+json"}).json()
|
|
29
|
+
|
|
30
|
+
project_versions = resp["versions"]
|
|
31
|
+
project_versions_sorted = sorted(project_versions, key=lambda x: list(map(int, x.split('.'))), reverse=True)
|
|
32
|
+
project_latest_version = project_versions_sorted[0]
|
|
33
|
+
|
|
34
|
+
return {"project_name": project_name, "pypi_project_url": pypi_project_url, "project_versions": project_versions, "project_latest_version": project_latest_version}
|
|
35
|
+
|
|
36
|
+
def update_pyproject_config(toml_data):
|
|
37
|
+
with open("pyproject.toml", "wb") as f:
|
|
38
|
+
tomli_w.dump(toml_data, f)
|
|
39
|
+
|
|
40
|
+
def set_version_manually(toml_data):
|
|
41
|
+
if "version" in toml_data["project"]["dynamic"]:
|
|
42
|
+
toml_data["project"]["dynamic"].remove("version")
|
|
43
|
+
update_pyproject_config(toml_data)
|
|
44
|
+
|
|
45
|
+
logging.info("Manual versioning selected. Please update the version number in pyproject.toml manually.")
|
|
46
|
+
|
|
47
|
+
def set_version_dynamically(toml_data):
|
|
48
|
+
if "version" in toml_data["project"]:
|
|
49
|
+
del toml_data["project"]["version"]
|
|
50
|
+
update_pyproject_config(toml_data)
|
|
51
|
+
|
|
52
|
+
if "version" not in toml_data["project"]["dynamic"]:
|
|
53
|
+
toml_data["project"]["dynamic"].append("version")
|
|
54
|
+
update_pyproject_config(toml_data)
|
|
55
|
+
|
|
56
|
+
logging.info("Dynamic versioning selected. Please set the version number in the 'version.txt' file.")
|
|
57
|
+
|
|
58
|
+
def set_version_automatically(toml_data):
|
|
59
|
+
project_name, pypi_project_url, project_versions, project_latest_version = get_pypi_repository_data(toml_data).values()
|
|
60
|
+
|
|
61
|
+
# Change the version number
|
|
62
|
+
project_versioning_list = project_latest_version.split(".")
|
|
63
|
+
# TODO: int to string
|
|
64
|
+
project_versioning_list[2] = f"{int(project_versioning_list[2]) + 1}"
|
|
65
|
+
logger.info(f"######## project_versioning_list: {project_versioning_list}")
|
|
66
|
+
new_project_version = '.'.join(project_versioning_list)
|
|
67
|
+
logger.info(f"######## new_project_version: {new_project_version}")
|
|
68
|
+
|
|
69
|
+
# Write the new version number
|
|
70
|
+
toml_data["project"]["version"] = new_project_version
|
|
71
|
+
if "version" in toml_data["project"]["dynamic"]:
|
|
72
|
+
toml_data["project"]["dynamic"].remove("version")
|
|
73
|
+
update_pyproject_config(toml_data)
|
|
74
|
+
logging.info(f"Automatic versioning selected. Version number updated to {new_project_version} in pyproject.toml.")
|
|
75
|
+
|
|
76
|
+
def incremental_versioning(versioning):
|
|
77
|
+
# Read project data from pyproject.toml
|
|
78
|
+
with open("pyproject.toml", "rb") as f:
|
|
79
|
+
toml_data = tomllib.load(f)
|
|
80
|
+
logger.info(f"######## toml_data: {toml_data}")
|
|
81
|
+
|
|
82
|
+
if "version" not in toml_data["project"]:
|
|
83
|
+
toml_data["project"]["version"] = ""
|
|
84
|
+
update_pyproject_config(toml_data)
|
|
85
|
+
|
|
86
|
+
if "dynamic" not in toml_data["project"]:
|
|
87
|
+
toml_data["project"]["dynamic"] = []
|
|
88
|
+
update_pyproject_config(toml_data)
|
|
89
|
+
|
|
90
|
+
logging.info(f"######## pypi_project_url: {f"{PYPI_BASE_URL}{toml_data["project"]["name"]}"}")
|
|
91
|
+
logging.info(f"######## Project: {get_pypi_repository_data(toml_data)['project_name']}")
|
|
92
|
+
logging.info(f"######## Version: {get_pypi_repository_data(toml_data)['project_latest_version']}")
|
|
93
|
+
|
|
94
|
+
if versioning == "manual":
|
|
95
|
+
set_version_manually(toml_data)
|
|
96
|
+
elif versioning == "dynamic":
|
|
97
|
+
set_version_dynamically(toml_data)
|
|
98
|
+
elif versioning == "automatic":
|
|
99
|
+
set_version_automatically(toml_data)
|
|
100
|
+
else:
|
|
101
|
+
set_version_manually(toml_data)
|
|
102
|
+
logging.info("Defaulting to manual versioning. Options: 'automatic', 'dynamic', 'manual'")
|
|
103
|
+
|
|
104
|
+
if __name__ == "__main__":
|
|
105
|
+
# TODO: replace in python-flask-dev pkg; passed in as var
|
|
106
|
+
incremental_versioning(VERSIONING)
|
|
107
|
+
#
|
|
108
|
+
# with open("pyproject.toml", "rb") as f:
|
|
109
|
+
# toml_data = tomllib.load(f)
|
|
110
|
+
# logger.info(f"############ toml_data: {toml_data}")
|
|
111
|
+
# #
|
|
112
|
+
# pypi_data = get_pypi_repository_data(toml_data)
|
|
113
|
+
# logger.info(f"############ pypi data: {pypi_data}")
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-flask-dev
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.11
|
|
4
4
|
Summary: Package containing modules with 'helper' functions to support the development of Python Flask applications.
|
|
5
5
|
Author-email: Dani <daniasestan@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/pypa/sampleproject
|
|
8
|
-
Project-URL: Issues, https://github.com/pypa/sampleproject/issues
|
|
9
7
|
Classifier: Programming Language :: Python :: 3
|
|
10
8
|
Classifier: Operating System :: POSIX :: Linux
|
|
11
9
|
Classifier: Framework :: Flask
|
{python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev.egg-info/SOURCES.txt
RENAMED
|
@@ -14,4 +14,6 @@ src/python_flask_dev.egg-info/PKG-INFO
|
|
|
14
14
|
src/python_flask_dev.egg-info/SOURCES.txt
|
|
15
15
|
src/python_flask_dev.egg-info/dependency_links.txt
|
|
16
16
|
src/python_flask_dev.egg-info/requires.txt
|
|
17
|
-
src/python_flask_dev.egg-info/top_level.txt
|
|
17
|
+
src/python_flask_dev.egg-info/top_level.txt
|
|
18
|
+
src/python_flask_dev/packaging/__init__.py
|
|
19
|
+
src/python_flask_dev/packaging/incremental_versioning.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev/custom_exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev/importing_modules.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev.egg-info/requires.txt
RENAMED
|
File without changes
|
{python_flask_dev-0.0.9 → python_flask_dev-0.0.11}/src/python_flask_dev.egg-info/top_level.txt
RENAMED
|
File without changes
|