pam-python 0.2.7__tar.gz → 0.2.8__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.
- {pam_python-0.2.7/pam_python.egg-info → pam_python-0.2.8}/PKG-INFO +4 -4
- {pam_python-0.2.7 → pam_python-0.2.8}/README.md +3 -3
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/__init__.py +1 -1
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/cli.py +5 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/project/uv/Dockerfile +1 -1
- {pam_python-0.2.7 → pam_python-0.2.8/pam_python.egg-info}/PKG-INFO +4 -4
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_cli_templates.py +19 -2
- {pam_python-0.2.7 → pam_python-0.2.8}/LICENSE.txt +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/api.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/interface_task_manager.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/logger.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/models/__init__.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/models/data_input_v2.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/models/request_command.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/models/sqlite_download.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/__init__.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/area.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/axis.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/bar.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/box_plot.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/bubble.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/candlestick.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/collection.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/definition.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/donut.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/errors.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/fields.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/heatmap.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/line.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/manager.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/metric.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/pie.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/polar_area.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/radar.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/radial_bar.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/range_area.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/range_bar.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/range_transform.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/record.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/scatter.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/schema.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/store.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/table.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/transport.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/reports/treemap.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/request_file_format.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/result_batch_uploader.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/server.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/service.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/sqlite.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/task_manager.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/temp_file_utils.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/buildcmd/pamb +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/buildcmd/pamb-base.sh +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/init/AGENT.md +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/init/REPORTS.md +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/init/dockerignore.tmpl +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/init/gitignore.tmpl +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/init/main.tmpl +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/init/pylintrc.tmpl +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/init/run_unit_test.bat +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/init/run_unit_test.ps1 +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/init/run_unit_test.sh +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/project/pip/Dockerfile +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/project/pip/requirements.txt +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/project/uv/pyproject.toml +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/project/uv/python-version +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/service/common/service.yaml +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/service/pandas/functions.tmpl +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/service/pandas/service.test.tmpl +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/service/pandas/service_class.tmpl +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/service/polars/functions.tmpl +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/service/polars/service.test.tmpl +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/templates/service/polars/service_class.tmpl +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/tester_task.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam/utils.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam_python.egg-info/SOURCES.txt +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam_python.egg-info/dependency_links.txt +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam_python.egg-info/entry_points.txt +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam_python.egg-info/requires.txt +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pam_python.egg-info/top_level.txt +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/pyproject.toml +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/setup.cfg +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_api.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_data_error_v2.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_data_input_v2.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_data_timeout_v2.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_range_transform.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_report_store.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_request_data_v2.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_result_batch_uploader.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_service_dataframe_output.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_sqlite_download_v2.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_temp_file_utils.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_area_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_bar_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_box_plot_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_bubble_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_candlestick_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_donut_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_heatmap_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_line_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_metric_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_pie_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_polar_area_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_radar_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_radial_bar_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_range_area_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_range_bar_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_scatter_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_table_report.py +0 -0
- {pam_python-0.2.7 → pam_python-0.2.8}/tests/test_typed_treemap_report.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pam-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.8
|
|
4
4
|
Summary: Pam Python Library
|
|
5
5
|
Author-email: Narongrit Kanhanoi <narongrit@pams.ai>
|
|
6
6
|
Project-URL: Homepage, https://github.com/heart/pam-python
|
|
@@ -70,9 +70,9 @@ uv add pam-python
|
|
|
70
70
|
uv run pam init
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
`pam init` recognizes a fresh uv project, keeps its uv configuration,
|
|
74
|
-
|
|
75
|
-
been edited.
|
|
73
|
+
`pam init` recognizes a fresh uv project, keeps its uv configuration, adds the
|
|
74
|
+
Flask and Gunicorn runtime dependencies, and adds the PAM scaffold. It refuses
|
|
75
|
+
projects whose generated source files have already been edited.
|
|
76
76
|
|
|
77
77
|
Pip remains supported for new projects that do not use uv:
|
|
78
78
|
|
|
@@ -50,9 +50,9 @@ uv add pam-python
|
|
|
50
50
|
uv run pam init
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
`pam init` recognizes a fresh uv project, keeps its uv configuration,
|
|
54
|
-
|
|
55
|
-
been edited.
|
|
53
|
+
`pam init` recognizes a fresh uv project, keeps its uv configuration, adds the
|
|
54
|
+
Flask and Gunicorn runtime dependencies, and adds the PAM scaffold. It refuses
|
|
55
|
+
projects whose generated source files have already been edited.
|
|
56
56
|
|
|
57
57
|
Pip remains supported for new projects that do not use uv:
|
|
58
58
|
|
|
@@ -59,6 +59,8 @@ ENGINE_DEPENDENCIES = {
|
|
|
59
59
|
"pandas": ["pandas>=2.2.3", "pyarrow>=19.0.1"],
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
UV_RUNTIME_DEPENDENCIES = ["Flask>=3.0.2", "gunicorn>=23.0.0"]
|
|
63
|
+
|
|
62
64
|
|
|
63
65
|
def main(argv=None):
|
|
64
66
|
args = list(sys.argv[1:] if argv is None else argv)
|
|
@@ -238,6 +240,9 @@ def init_project(package_manager: str | None = None):
|
|
|
238
240
|
if not _prompt_overwrite_if_needed(destination, templates):
|
|
239
241
|
return
|
|
240
242
|
|
|
243
|
+
if preinitialized_uv:
|
|
244
|
+
_run_uv(["add", *UV_RUNTIME_DEPENDENCIES], destination)
|
|
245
|
+
|
|
241
246
|
with tempfile.TemporaryDirectory(prefix=".pam-init-", dir=destination) as temp_dir:
|
|
242
247
|
staging = Path(temp_dir)
|
|
243
248
|
for src, dest in templates.items():
|
|
@@ -17,4 +17,4 @@ RUN mkdir -p "$DATA_FOLDER"
|
|
|
17
17
|
EXPOSE 8000
|
|
18
18
|
|
|
19
19
|
# Keep one worker: service lifecycle state is local to the process.
|
|
20
|
-
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:8000", "main:app"]
|
|
20
|
+
CMD ["uv", "run", "--no-sync", "gunicorn", "-w", "1", "-b", "0.0.0.0:8000", "main:app"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pam-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.8
|
|
4
4
|
Summary: Pam Python Library
|
|
5
5
|
Author-email: Narongrit Kanhanoi <narongrit@pams.ai>
|
|
6
6
|
Project-URL: Homepage, https://github.com/heart/pam-python
|
|
@@ -70,9 +70,9 @@ uv add pam-python
|
|
|
70
70
|
uv run pam init
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
`pam init` recognizes a fresh uv project, keeps its uv configuration,
|
|
74
|
-
|
|
75
|
-
been edited.
|
|
73
|
+
`pam init` recognizes a fresh uv project, keeps its uv configuration, adds the
|
|
74
|
+
Flask and Gunicorn runtime dependencies, and adds the PAM scaffold. It refuses
|
|
75
|
+
projects whose generated source files have already been edited.
|
|
76
76
|
|
|
77
77
|
Pip remains supported for new projects that do not use uv:
|
|
78
78
|
|
|
@@ -151,15 +151,23 @@ class CLITemplateTest(unittest.TestCase):
|
|
|
151
151
|
|
|
152
152
|
root = Path(temp_dir)
|
|
153
153
|
self.assertTrue((root / "pyproject.toml").is_file())
|
|
154
|
+
self.assertIn(
|
|
155
|
+
'"gunicorn>=23.0.0"',
|
|
156
|
+
(root / "pyproject.toml").read_text(),
|
|
157
|
+
)
|
|
154
158
|
self.assertTrue((root / "uv.lock").is_file())
|
|
155
159
|
self.assertFalse((root / "requirements.txt").exists())
|
|
156
160
|
self.assertFalse((root / "run_unit_test.sh").exists())
|
|
161
|
+
self.assertIn(
|
|
162
|
+
'CMD ["uv", "run", "--no-sync", "gunicorn"',
|
|
163
|
+
(root / "Dockerfile").read_text(),
|
|
164
|
+
)
|
|
157
165
|
self.assertEqual(
|
|
158
166
|
[["lock"], ["add", "polars>=1.43.0"]],
|
|
159
167
|
calls,
|
|
160
168
|
)
|
|
161
169
|
|
|
162
|
-
def
|
|
170
|
+
def test_init_adopts_a_fresh_uv_project_and_adds_runtime_dependencies(self):
|
|
163
171
|
calls = []
|
|
164
172
|
original_pyproject = """[project]
|
|
165
173
|
name = "customer-plugin"
|
|
@@ -196,8 +204,15 @@ if __name__ == "__main__":
|
|
|
196
204
|
self.assertEqual("version = 1\n", (root / "uv.lock").read_text())
|
|
197
205
|
self.assertEqual(".venv\n", (root / ".gitignore").read_text())
|
|
198
206
|
self.assertIn("plugin_server = Server", (root / "main.py").read_text())
|
|
207
|
+
self.assertIn(
|
|
208
|
+
'CMD ["uv", "run", "--no-sync", "gunicorn"',
|
|
209
|
+
(root / "Dockerfile").read_text(),
|
|
210
|
+
)
|
|
199
211
|
self.assertEqual("uv", json.loads((root / ".pam-project").read_text())["package_manager"])
|
|
200
|
-
self.assertEqual(
|
|
212
|
+
self.assertEqual(
|
|
213
|
+
[["add", "Flask>=3.0.2", "gunicorn>=23.0.0"]],
|
|
214
|
+
calls,
|
|
215
|
+
)
|
|
201
216
|
|
|
202
217
|
def test_init_adds_gitignore_when_fresh_uv_project_does_not_have_one(self):
|
|
203
218
|
uv_main = '''def main():
|
|
@@ -220,6 +235,8 @@ if __name__ == "__main__":
|
|
|
220
235
|
(root / "main.py").write_text(uv_main)
|
|
221
236
|
|
|
222
237
|
with mock.patch.object(cli.shutil, "which", return_value="/usr/bin/uv"), mock.patch.object(
|
|
238
|
+
cli, "_run_uv"
|
|
239
|
+
), mock.patch.object(
|
|
223
240
|
cli.sys.stdin, "isatty", return_value=True
|
|
224
241
|
), mock.patch("builtins.input", return_value="y"):
|
|
225
242
|
cli.init_project()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|