edx-api-doc-tools 2.0.0__tar.gz → 2.1.2__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.
Files changed (25) hide show
  1. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/CHANGELOG.rst +12 -2
  2. {edx_api_doc_tools-2.0.0/edx_api_doc_tools.egg-info → edx_api_doc_tools-2.1.2}/PKG-INFO +26 -5
  3. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools/__init__.py +1 -1
  4. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2/edx_api_doc_tools.egg-info}/PKG-INFO +26 -5
  5. edx_api_doc_tools-2.1.2/setup.py +183 -0
  6. edx_api_doc_tools-2.0.0/setup.py +0 -136
  7. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/LICENSE.txt +0 -0
  8. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/MANIFEST.in +0 -0
  9. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/README.rst +0 -0
  10. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools/apps.py +0 -0
  11. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools/conf_utils.py +0 -0
  12. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools/data.py +0 -0
  13. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools/internal_utils.py +0 -0
  14. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools/urls.py +0 -0
  15. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools/view_utils.py +0 -0
  16. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools.egg-info/SOURCES.txt +0 -0
  17. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools.egg-info/dependency_links.txt +0 -0
  18. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools.egg-info/not-zip-safe +0 -0
  19. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools.egg-info/requires.txt +0 -0
  20. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/edx_api_doc_tools.egg-info/top_level.txt +0 -0
  21. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/requirements/base.in +0 -0
  22. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/requirements/constraints.txt +0 -0
  23. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/setup.cfg +0 -0
  24. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/tests/test_doc_tools.py +0 -0
  25. {edx_api_doc_tools-2.0.0 → edx_api_doc_tools-2.1.2}/tests/test_example.py +0 -0
@@ -14,6 +14,18 @@ Change Log
14
14
  Unreleased
15
15
  ----------
16
16
 
17
+ 2.1.2 - 2026-01-39
18
+ ------------------
19
+ * Fix builds to PyPI
20
+
21
+ 2.1.1 - 2026-01-39
22
+ ------------------
23
+ * Fix make upgrade, update dependencies
24
+
25
+ 2.1.0 - 2025-04-18
26
+ ------------------
27
+ * Added Support for ``django 5.2``.
28
+
17
29
  2.0.0 --- 2024-09-09
18
30
  --------------------
19
31
  * Drop support for Python 3.8
@@ -24,8 +36,6 @@ Unreleased
24
36
  * Add support for python 3.11 and 3.12 support.
25
37
  * Removed django32 support.
26
38
 
27
-
28
-
29
39
  1.7.0 --- 2023-07-23
30
40
  --------------------
31
41
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: edx-api-doc-tools
3
- Version: 2.0.0
3
+ Version: 2.1.2
4
4
  Summary: Tools for writing and generating API documentation for edX REST APIs
5
5
  Home-page: https://github.com/openedx/api-doc-tools
6
6
  Author: Open edX Project
@@ -10,11 +10,11 @@ Keywords: Django edx
10
10
  Classifier: Development Status :: 3 - Alpha
11
11
  Classifier: Framework :: Django
12
12
  Classifier: Framework :: Django :: 4.2
13
+ Classifier: Framework :: Django :: 5.2
13
14
  Classifier: Intended Audience :: Developers
14
15
  Classifier: License :: OSI Approved :: Apache Software License
15
16
  Classifier: Natural Language :: English
16
17
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.8
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
20
  Description-Content-Type: text/x-rst
@@ -23,6 +23,17 @@ Requires-Dist: Django
23
23
  Requires-Dist: djangorestframework>=3.2.0
24
24
  Requires-Dist: drf-yasg
25
25
  Requires-Dist: setuptools
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: description-content-type
31
+ Dynamic: home-page
32
+ Dynamic: keywords
33
+ Dynamic: license
34
+ Dynamic: license-file
35
+ Dynamic: requires-dist
36
+ Dynamic: summary
26
37
 
27
38
  edX API Documentation Tools
28
39
  ===========================
@@ -139,6 +150,18 @@ Change Log
139
150
  Unreleased
140
151
  ----------
141
152
 
153
+ 2.1.2 - 2026-01-39
154
+ ------------------
155
+ * Fix builds to PyPI
156
+
157
+ 2.1.1 - 2026-01-39
158
+ ------------------
159
+ * Fix make upgrade, update dependencies
160
+
161
+ 2.1.0 - 2025-04-18
162
+ ------------------
163
+ * Added Support for ``django 5.2``.
164
+
142
165
  2.0.0 --- 2024-09-09
143
166
  --------------------
144
167
  * Drop support for Python 3.8
@@ -149,8 +172,6 @@ Unreleased
149
172
  * Add support for python 3.11 and 3.12 support.
150
173
  * Removed django32 support.
151
174
 
152
-
153
-
154
175
  1.7.0 --- 2023-07-23
155
176
  --------------------
156
177
 
@@ -46,4 +46,4 @@ from .view_utils import (
46
46
  )
47
47
 
48
48
 
49
- __version__ = '2.0.0'
49
+ __version__ = "2.1.2"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: edx-api-doc-tools
3
- Version: 2.0.0
3
+ Version: 2.1.2
4
4
  Summary: Tools for writing and generating API documentation for edX REST APIs
5
5
  Home-page: https://github.com/openedx/api-doc-tools
6
6
  Author: Open edX Project
@@ -10,11 +10,11 @@ Keywords: Django edx
10
10
  Classifier: Development Status :: 3 - Alpha
11
11
  Classifier: Framework :: Django
12
12
  Classifier: Framework :: Django :: 4.2
13
+ Classifier: Framework :: Django :: 5.2
13
14
  Classifier: Intended Audience :: Developers
14
15
  Classifier: License :: OSI Approved :: Apache Software License
15
16
  Classifier: Natural Language :: English
16
17
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.8
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
20
  Description-Content-Type: text/x-rst
@@ -23,6 +23,17 @@ Requires-Dist: Django
23
23
  Requires-Dist: djangorestframework>=3.2.0
24
24
  Requires-Dist: drf-yasg
25
25
  Requires-Dist: setuptools
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: description-content-type
31
+ Dynamic: home-page
32
+ Dynamic: keywords
33
+ Dynamic: license
34
+ Dynamic: license-file
35
+ Dynamic: requires-dist
36
+ Dynamic: summary
26
37
 
27
38
  edX API Documentation Tools
28
39
  ===========================
@@ -139,6 +150,18 @@ Change Log
139
150
  Unreleased
140
151
  ----------
141
152
 
153
+ 2.1.2 - 2026-01-39
154
+ ------------------
155
+ * Fix builds to PyPI
156
+
157
+ 2.1.1 - 2026-01-39
158
+ ------------------
159
+ * Fix make upgrade, update dependencies
160
+
161
+ 2.1.0 - 2025-04-18
162
+ ------------------
163
+ * Added Support for ``django 5.2``.
164
+
142
165
  2.0.0 --- 2024-09-09
143
166
  --------------------
144
167
  * Drop support for Python 3.8
@@ -149,8 +172,6 @@ Unreleased
149
172
  * Add support for python 3.11 and 3.12 support.
150
173
  * Removed django32 support.
151
174
 
152
-
153
-
154
175
  1.7.0 --- 2023-07-23
155
176
  --------------------
156
177
 
@@ -0,0 +1,183 @@
1
+ #!/usr/bin/env python
2
+ """
3
+ Package metadata for edx_api_doc_tools.
4
+ """
5
+
6
+ import os
7
+ import re
8
+ import sys
9
+
10
+ from setuptools import setup
11
+
12
+
13
+ # We open files with one-line shorthands, it's ok.
14
+ # pylint: disable=consider-using-with
15
+
16
+
17
+ def get_version(*file_paths):
18
+ """
19
+ Extract the version string from the file at the given relative path fragments.
20
+ """
21
+ filename = os.path.join(os.path.dirname(__file__), *file_paths)
22
+ version_file = open(filename, encoding="utf-8").read()
23
+ version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
24
+ if version_match:
25
+ return version_match.group(1)
26
+ raise RuntimeError("Unable to find version string.")
27
+
28
+
29
+ def load_requirements(*requirements_paths):
30
+ """
31
+ Load all requirements from the specified requirements files.
32
+
33
+ Requirements will include any constraints from files specified
34
+ with -c in the requirements files.
35
+ Returns a list of requirement strings.
36
+ """
37
+ # UPDATED VIA SEMGREP - if you need to remove/modify this method remove this line and add a comment specifying why.
38
+
39
+ # e.g. {"django": "Django", "confluent-kafka": "confluent_kafka[avro]"}
40
+ by_canonical_name = {}
41
+
42
+ def check_name_consistent(package):
43
+ """
44
+ Raise exception if package is named different ways.
45
+
46
+ This ensures that packages are named consistently so we can match
47
+ constraints to packages. It also ensures that if we require a package
48
+ with extras we don't constrain it without mentioning the extras (since
49
+ that too would interfere with matching constraints.)
50
+ """
51
+ canonical = package.lower().replace("_", "-").split("[")[0]
52
+ seen_spelling = by_canonical_name.get(canonical)
53
+ if seen_spelling is None:
54
+ by_canonical_name[canonical] = package
55
+ elif seen_spelling != package:
56
+ raise RuntimeError(
57
+ f'Encountered both "{seen_spelling}" and "{package}" in requirements '
58
+ "and constraints files; please use just one or the other."
59
+ )
60
+
61
+ requirements = {}
62
+ constraint_files = set()
63
+
64
+ # groups "pkg<=x.y.z,..." into ("pkg", "<=x.y.z,...")
65
+ re_package_name_base_chars = r"a-zA-Z0-9\-_." # chars allowed in base package name
66
+ # Two groups: name[maybe,extras], and optionally a constraint
67
+ requirement_line_regex = re.compile(
68
+ r"([%s]+(?:\[[%s,\s]+\])?)([<>=][^#\s]+)?"
69
+ % (re_package_name_base_chars, re_package_name_base_chars)
70
+ )
71
+
72
+ def add_version_constraint_or_raise(
73
+ current_line, current_requirements, add_if_not_present
74
+ ):
75
+ regex_match = requirement_line_regex.match(current_line)
76
+ if regex_match:
77
+ package = regex_match.group(1)
78
+ version_constraints = regex_match.group(2)
79
+ check_name_consistent(package)
80
+ existing_version_constraints = current_requirements.get(package, None)
81
+ # It's fine to add constraints to an unconstrained package,
82
+ # but raise an error if there are already constraints in place.
83
+ if (
84
+ existing_version_constraints
85
+ and existing_version_constraints != version_constraints
86
+ ):
87
+ raise BaseException(
88
+ f"Multiple constraint definitions found for {package}:"
89
+ f' "{existing_version_constraints}" and "{version_constraints}".'
90
+ f"Combine constraints into one location with {package}"
91
+ f"{existing_version_constraints},{version_constraints}."
92
+ )
93
+ if add_if_not_present or package in current_requirements:
94
+ current_requirements[package] = version_constraints
95
+
96
+ # Read requirements from .in files and store the path to any
97
+ # constraint files that are pulled in.
98
+ for path in requirements_paths:
99
+ with open(path) as reqs:
100
+ for line in reqs:
101
+ if is_requirement(line):
102
+ add_version_constraint_or_raise(line, requirements, True)
103
+ if line and line.startswith("-c") and not line.startswith("-c http"):
104
+ constraint_files.add(
105
+ os.path.dirname(path)
106
+ + "/"
107
+ + line.split("#")[0].replace("-c", "").strip()
108
+ )
109
+
110
+ # process constraint files: add constraints to existing requirements
111
+ for constraint_file in constraint_files:
112
+ with open(constraint_file) as reader:
113
+ for line in reader:
114
+ if is_requirement(line):
115
+ add_version_constraint_or_raise(line, requirements, False)
116
+
117
+ # process back into list of pkg><=constraints strings
118
+ constrained_requirements = [
119
+ f"{pkg}{version or ''}" for (pkg, version) in sorted(requirements.items())
120
+ ]
121
+ return constrained_requirements
122
+
123
+
124
+ def is_requirement(line):
125
+ """
126
+ Return True if the requirement line is a package requirement.
127
+
128
+ Returns:
129
+ bool: True if the line is not blank, a comment,
130
+ a URL, or an included file
131
+ """
132
+ # UPDATED VIA SEMGREP - if you need to remove/modify this method remove this line and add a comment specifying why
133
+
134
+ return (
135
+ line and line.strip() and not line.startswith(("-r", "#", "-e", "git+", "-c"))
136
+ )
137
+
138
+
139
+ VERSION = get_version("edx_api_doc_tools", "__init__.py")
140
+
141
+ if sys.argv[-1] == "tag":
142
+ print("Tagging the version on github:")
143
+ os.system("git tag -a %s -m 'version %s'" % (VERSION, VERSION))
144
+ os.system("git push --tags")
145
+ sys.exit()
146
+
147
+ README = open(
148
+ os.path.join(os.path.dirname(__file__), "README.rst"), encoding="utf-8"
149
+ ).read()
150
+ CHANGELOG = open(
151
+ os.path.join(os.path.dirname(__file__), "CHANGELOG.rst"), encoding="utf-8"
152
+ ).read()
153
+
154
+ setup(
155
+ name="edx-api-doc-tools",
156
+ version=VERSION,
157
+ description="Tools for writing and generating API documentation for edX REST APIs",
158
+ long_description=README + "\n\n" + CHANGELOG,
159
+ long_description_content_type="text/x-rst",
160
+ author="Open edX Project",
161
+ author_email="oscm@openedx.org",
162
+ url="https://github.com/openedx/api-doc-tools",
163
+ packages=[
164
+ "edx_api_doc_tools",
165
+ ],
166
+ include_package_data=True,
167
+ install_requires=load_requirements("requirements/base.in"),
168
+ license="Apache Software License 2.0",
169
+ zip_safe=False,
170
+ keywords="Django edx",
171
+ classifiers=[
172
+ "Development Status :: 3 - Alpha",
173
+ "Framework :: Django",
174
+ "Framework :: Django :: 4.2",
175
+ "Framework :: Django :: 5.2",
176
+ "Intended Audience :: Developers",
177
+ "License :: OSI Approved :: Apache Software License",
178
+ "Natural Language :: English",
179
+ "Programming Language :: Python :: 3",
180
+ "Programming Language :: Python :: 3.11",
181
+ "Programming Language :: Python :: 3.12",
182
+ ],
183
+ )
@@ -1,136 +0,0 @@
1
- #!/usr/bin/env python
2
- """
3
- Package metadata for edx_api_doc_tools.
4
- """
5
-
6
- import os
7
- import re
8
- import sys
9
-
10
- from setuptools import setup
11
-
12
-
13
- # We open files with one-line shorthands, it's ok.
14
- # pylint: disable=consider-using-with
15
-
16
-
17
- def get_version(*file_paths):
18
- """
19
- Extract the version string from the file at the given relative path fragments.
20
- """
21
- filename = os.path.join(os.path.dirname(__file__), *file_paths)
22
- version_file = open(filename, encoding='utf-8').read()
23
- version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
24
- version_file, re.M)
25
- if version_match:
26
- return version_match.group(1)
27
- raise RuntimeError('Unable to find version string.')
28
-
29
-
30
- def load_requirements(*requirements_paths):
31
- """
32
- Load all requirements from the specified requirements files.
33
-
34
- Requirements will include any constraints from files specified
35
- with -c in the requirements files.
36
- Returns a list of requirement strings.
37
- """
38
- # UPDATED VIA SEMGREP - if you need to remove/modify this method remove this line and add a comment specifying why.
39
-
40
- requirements = {}
41
- constraint_files = set()
42
-
43
- # groups "my-package-name<=x.y.z,..." into ("my-package-name", "<=x.y.z,...")
44
- requirement_line_regex = re.compile(r"([a-zA-Z0-9-_.]+)([<>=][^#\s]+)?")
45
-
46
- def add_version_constraint_or_raise(current_line, current_requirements, add_if_not_present):
47
- regex_match = requirement_line_regex.match(current_line)
48
- if regex_match:
49
- package = regex_match.group(1)
50
- version_constraints = regex_match.group(2)
51
- existing_version_constraints = current_requirements.get(package, None)
52
- # it's fine to add constraints to an unconstrained package, but raise an error if there are already
53
- # constraints in place
54
- if existing_version_constraints and existing_version_constraints != version_constraints:
55
- raise BaseException(f'Multiple constraint definitions found for {package}:'
56
- f' "{existing_version_constraints}" and "{version_constraints}".'
57
- f'Combine constraints into one location with {package}'
58
- f'{existing_version_constraints},{version_constraints}.')
59
- if add_if_not_present or package in current_requirements:
60
- current_requirements[package] = version_constraints
61
-
62
- # process .in files and store the path to any constraint files that are pulled in
63
- for path in requirements_paths:
64
- with open(path) as reqs:
65
- for line in reqs:
66
- if is_requirement(line):
67
- add_version_constraint_or_raise(line, requirements, True)
68
- if line and line.startswith('-c') and not line.startswith('-c http'):
69
- constraint_files.add(os.path.dirname(path) + '/' + line.split('#')[0].replace('-c', '').strip())
70
-
71
- # process constraint files and add any new constraints found to existing requirements
72
- for constraint_file in constraint_files:
73
- with open(constraint_file) as reader:
74
- for line in reader:
75
- if is_requirement(line):
76
- add_version_constraint_or_raise(line, requirements, False)
77
-
78
- # process back into list of pkg><=constraints strings
79
- constrained_requirements = [f'{pkg}{version or ""}' for (pkg, version) in sorted(requirements.items())]
80
- return constrained_requirements
81
-
82
-
83
- def is_requirement(line):
84
- """
85
- Return True if the requirement line is a package requirement.
86
-
87
- Returns:
88
- bool: True if the line is not blank, a comment,
89
- a URL, or an included file
90
- """
91
- # UPDATED VIA SEMGREP - if you need to remove/modify this method remove this line and add a comment specifying why
92
-
93
- return line and line.strip() and not line.startswith(('-r', '#', '-e', 'git+', '-c'))
94
-
95
-
96
- VERSION = get_version('edx_api_doc_tools', '__init__.py')
97
-
98
- if sys.argv[-1] == 'tag':
99
- print("Tagging the version on github:")
100
- os.system("git tag -a %s -m 'version %s'" % (VERSION, VERSION))
101
- os.system("git push --tags")
102
- sys.exit()
103
-
104
- README = open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8').read()
105
- CHANGELOG = open(os.path.join(os.path.dirname(__file__), 'CHANGELOG.rst'), encoding='utf-8').read()
106
-
107
- setup(
108
- name='edx-api-doc-tools',
109
- version=VERSION,
110
- description="Tools for writing and generating API documentation for edX REST APIs",
111
- long_description=README + '\n\n' + CHANGELOG,
112
- long_description_content_type="text/x-rst",
113
- author='Open edX Project',
114
- author_email='oscm@openedx.org',
115
- url='https://github.com/openedx/api-doc-tools',
116
- packages=[
117
- 'edx_api_doc_tools',
118
- ],
119
- include_package_data=True,
120
- install_requires=load_requirements('requirements/base.in'),
121
- license="Apache Software License 2.0",
122
- zip_safe=False,
123
- keywords='Django edx',
124
- classifiers=[
125
- 'Development Status :: 3 - Alpha',
126
- 'Framework :: Django',
127
- 'Framework :: Django :: 4.2',
128
- 'Intended Audience :: Developers',
129
- 'License :: OSI Approved :: Apache Software License',
130
- 'Natural Language :: English',
131
- 'Programming Language :: Python :: 3',
132
- 'Programming Language :: Python :: 3.8',
133
- 'Programming Language :: Python :: 3.11',
134
- 'Programming Language :: Python :: 3.12',
135
- ],
136
- )