cookiecutter_pywf_open_source_demo 1.0.0__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.
- cookiecutter_pywf_open_source_demo-1.0.0/AUTHORS.rst +15 -0
- cookiecutter_pywf_open_source_demo-1.0.0/LICENSE.txt +21 -0
- cookiecutter_pywf_open_source_demo-1.0.0/PKG-INFO +119 -0
- cookiecutter_pywf_open_source_demo-1.0.0/README.rst +71 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo/__init__.py +9 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo/_version.py +15 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo/api.py +2 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo/paths.py +60 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo/vendor/__init__.py +2 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo/vendor/pytest_cov_helper.py +148 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo.egg-info/PKG-INFO +119 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo.egg-info/SOURCES.txt +16 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo.egg-info/dependency_links.txt +1 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo.egg-info/requires.txt +28 -0
- cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo.egg-info/top_level.txt +1 -0
- cookiecutter_pywf_open_source_demo-1.0.0/pyproject.toml +165 -0
- cookiecutter_pywf_open_source_demo-1.0.0/setup.cfg +4 -0
- cookiecutter_pywf_open_source_demo-1.0.0/tests/test_api.py +17 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.. _about_author:
|
|
2
|
+
|
|
3
|
+
About the Author
|
|
4
|
+
------------------------------------------------------------------------------
|
|
5
|
+
::
|
|
6
|
+
|
|
7
|
+
(\ (\
|
|
8
|
+
( -.-)o
|
|
9
|
+
o_(")(")
|
|
10
|
+
|
|
11
|
+
**Sanhe Hu** is a seasoned software engineer with a deep passion for Python development since 2010. As an author and maintainer of `150+ open-source Python projects <https://pypi.org/user/machugwu/>`_, with over `15 million monthly downloads <https://github.com/MacHu-GWU>`_, I bring a wealth of experience to the table. As a Senior Solution Architect and Subject Matter Expert in AI, Data, Amazon Web Services, Cloud Engineering, DevOps, I thrive on helping clients with platform design, enterprise architecture, and strategic roadmaps.
|
|
12
|
+
|
|
13
|
+
Talk is cheap, show me the code:
|
|
14
|
+
|
|
15
|
+
- My Github: https://github.com/MacHu-GWU
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright 2025 Sanhe Hu <https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cookiecutter_pywf_open_source_demo
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: An example project generated by cookiecutter-pywf_open_source.
|
|
5
|
+
Author-email: Sanhe Hu <husanhe@gmail.com>
|
|
6
|
+
Maintainer-email: Sanhe Hu <husanhe@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
9
|
+
Project-URL: Documentation, https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/
|
|
10
|
+
Project-URL: Repository, https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
11
|
+
Project-URL: Issues, https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/blob/main/release-history.rst
|
|
13
|
+
Project-URL: Download, https://pypi.org/pypi/cookiecutter-pywf-open-source-demo#files
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: MacOS
|
|
19
|
+
Classifier: Operating System :: Unix
|
|
20
|
+
Requires-Python: <4.0,>=3.10
|
|
21
|
+
Description-Content-Type: text/x-rst
|
|
22
|
+
License-File: LICENSE.txt
|
|
23
|
+
License-File: AUTHORS.rst
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: twine<7.0.0,>=6.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: wheel<1.0.0,>=0.45.0; extra == "dev"
|
|
27
|
+
Requires-Dist: build<2.0.0,>=1.2.1; extra == "dev"
|
|
28
|
+
Requires-Dist: rich<14.0.0,>=13.8.1; extra == "dev"
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: pytest<9.0.0,>=8.2.2; extra == "test"
|
|
31
|
+
Requires-Dist: pytest-cov<7.0.0,>=6.0.0; extra == "test"
|
|
32
|
+
Provides-Extra: doc
|
|
33
|
+
Requires-Dist: Sphinx<8.0.0,>=7.4.7; extra == "doc"
|
|
34
|
+
Requires-Dist: sphinx-copybutton<1.0.0,>=0.5.2; extra == "doc"
|
|
35
|
+
Requires-Dist: sphinx-design<1.0.0,>=0.6.1; extra == "doc"
|
|
36
|
+
Requires-Dist: sphinx-jinja<3.0.0,>=2.0.2; extra == "doc"
|
|
37
|
+
Requires-Dist: furo==2024.8.6; extra == "doc"
|
|
38
|
+
Requires-Dist: pygments<3.0.0,>=2.18.0; extra == "doc"
|
|
39
|
+
Requires-Dist: ipython<8.19.0,>=8.18.1; extra == "doc"
|
|
40
|
+
Requires-Dist: nbsphinx<1.0.0,>=0.8.12; extra == "doc"
|
|
41
|
+
Requires-Dist: rstobj==1.2.1; extra == "doc"
|
|
42
|
+
Requires-Dist: docfly==3.0.0; extra == "doc"
|
|
43
|
+
Provides-Extra: mise
|
|
44
|
+
Requires-Dist: PyGithub<3.0.0,>=2.8.0; extra == "mise"
|
|
45
|
+
Requires-Dist: httpx<1.0.0,>=0.28.0; extra == "mise"
|
|
46
|
+
Provides-Extra: auto
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
.. image:: https://readthedocs.org/projects/cookiecutter-pywf-open-source-demo/badge/?version=latest
|
|
51
|
+
:target: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/
|
|
52
|
+
:alt: Documentation Status
|
|
53
|
+
|
|
54
|
+
.. image:: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/actions/workflows/main.yml/badge.svg
|
|
55
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/actions?query=workflow:CI
|
|
56
|
+
|
|
57
|
+
.. image:: https://codecov.io/gh/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/branch/main/graph/badge.svg
|
|
58
|
+
:target: https://codecov.io/gh/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
59
|
+
|
|
60
|
+
.. image:: https://img.shields.io/pypi/v/cookiecutter-pywf-open-source-demo.svg
|
|
61
|
+
:target: https://pypi.python.org/pypi/cookiecutter-pywf-open-source-demo
|
|
62
|
+
|
|
63
|
+
.. image:: https://img.shields.io/pypi/l/cookiecutter-pywf-open-source-demo.svg
|
|
64
|
+
:target: https://pypi.python.org/pypi/cookiecutter-pywf-open-source-demo
|
|
65
|
+
|
|
66
|
+
.. image:: https://img.shields.io/pypi/pyversions/cookiecutter-pywf-open-source-demo.svg
|
|
67
|
+
:target: https://pypi.python.org/pypi/cookiecutter-pywf-open-source-demo
|
|
68
|
+
|
|
69
|
+
.. image:: https://img.shields.io/badge/✍️_Release_History!--None.svg?style=social&logo=github
|
|
70
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/blob/main/release-history.rst
|
|
71
|
+
|
|
72
|
+
.. image:: https://img.shields.io/badge/⭐_Star_me_on_GitHub!--None.svg?style=social&logo=github
|
|
73
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
74
|
+
|
|
75
|
+
------
|
|
76
|
+
|
|
77
|
+
.. image:: https://img.shields.io/badge/Link-API-blue.svg
|
|
78
|
+
:target: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/py-modindex.html
|
|
79
|
+
|
|
80
|
+
.. image:: https://img.shields.io/badge/Link-Install-blue.svg
|
|
81
|
+
:target: `install`_
|
|
82
|
+
|
|
83
|
+
.. image:: https://img.shields.io/badge/Link-GitHub-blue.svg
|
|
84
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
85
|
+
|
|
86
|
+
.. image:: https://img.shields.io/badge/Link-Submit_Issue-blue.svg
|
|
87
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/issues
|
|
88
|
+
|
|
89
|
+
.. image:: https://img.shields.io/badge/Link-Request_Feature-blue.svg
|
|
90
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/issues
|
|
91
|
+
|
|
92
|
+
.. image:: https://img.shields.io/badge/Link-Download-blue.svg
|
|
93
|
+
:target: https://pypi.org/pypi/cookiecutter-pywf-open-source-demo#files
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
Welcome to ``cookiecutter_pywf_open_source_demo`` Documentation
|
|
97
|
+
==============================================================================
|
|
98
|
+
.. image:: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/_static/cookiecutter_pywf_open_source_demo-logo.png
|
|
99
|
+
:target: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/
|
|
100
|
+
|
|
101
|
+
Documentation for ``cookiecutter_pywf_open_source_demo``.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
.. _install:
|
|
105
|
+
|
|
106
|
+
Install
|
|
107
|
+
------------------------------------------------------------------------------
|
|
108
|
+
|
|
109
|
+
``cookiecutter_pywf_open_source_demo`` is released on PyPI, so all you need is to:
|
|
110
|
+
|
|
111
|
+
.. code-block:: console
|
|
112
|
+
|
|
113
|
+
$ pip install cookiecutter-pywf-open-source-demo
|
|
114
|
+
|
|
115
|
+
To upgrade to latest version:
|
|
116
|
+
|
|
117
|
+
.. code-block:: console
|
|
118
|
+
|
|
119
|
+
$ pip install --upgrade cookiecutter-pywf-open-source-demo
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
|
|
2
|
+
.. image:: https://readthedocs.org/projects/cookiecutter-pywf-open-source-demo/badge/?version=latest
|
|
3
|
+
:target: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/
|
|
4
|
+
:alt: Documentation Status
|
|
5
|
+
|
|
6
|
+
.. image:: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/actions/workflows/main.yml/badge.svg
|
|
7
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/actions?query=workflow:CI
|
|
8
|
+
|
|
9
|
+
.. image:: https://codecov.io/gh/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/branch/main/graph/badge.svg
|
|
10
|
+
:target: https://codecov.io/gh/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
11
|
+
|
|
12
|
+
.. image:: https://img.shields.io/pypi/v/cookiecutter-pywf-open-source-demo.svg
|
|
13
|
+
:target: https://pypi.python.org/pypi/cookiecutter-pywf-open-source-demo
|
|
14
|
+
|
|
15
|
+
.. image:: https://img.shields.io/pypi/l/cookiecutter-pywf-open-source-demo.svg
|
|
16
|
+
:target: https://pypi.python.org/pypi/cookiecutter-pywf-open-source-demo
|
|
17
|
+
|
|
18
|
+
.. image:: https://img.shields.io/pypi/pyversions/cookiecutter-pywf-open-source-demo.svg
|
|
19
|
+
:target: https://pypi.python.org/pypi/cookiecutter-pywf-open-source-demo
|
|
20
|
+
|
|
21
|
+
.. image:: https://img.shields.io/badge/✍️_Release_History!--None.svg?style=social&logo=github
|
|
22
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/blob/main/release-history.rst
|
|
23
|
+
|
|
24
|
+
.. image:: https://img.shields.io/badge/⭐_Star_me_on_GitHub!--None.svg?style=social&logo=github
|
|
25
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
26
|
+
|
|
27
|
+
------
|
|
28
|
+
|
|
29
|
+
.. image:: https://img.shields.io/badge/Link-API-blue.svg
|
|
30
|
+
:target: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/py-modindex.html
|
|
31
|
+
|
|
32
|
+
.. image:: https://img.shields.io/badge/Link-Install-blue.svg
|
|
33
|
+
:target: `install`_
|
|
34
|
+
|
|
35
|
+
.. image:: https://img.shields.io/badge/Link-GitHub-blue.svg
|
|
36
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
37
|
+
|
|
38
|
+
.. image:: https://img.shields.io/badge/Link-Submit_Issue-blue.svg
|
|
39
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/issues
|
|
40
|
+
|
|
41
|
+
.. image:: https://img.shields.io/badge/Link-Request_Feature-blue.svg
|
|
42
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/issues
|
|
43
|
+
|
|
44
|
+
.. image:: https://img.shields.io/badge/Link-Download-blue.svg
|
|
45
|
+
:target: https://pypi.org/pypi/cookiecutter-pywf-open-source-demo#files
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
Welcome to ``cookiecutter_pywf_open_source_demo`` Documentation
|
|
49
|
+
==============================================================================
|
|
50
|
+
.. image:: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/_static/cookiecutter_pywf_open_source_demo-logo.png
|
|
51
|
+
:target: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/
|
|
52
|
+
|
|
53
|
+
Documentation for ``cookiecutter_pywf_open_source_demo``.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
.. _install:
|
|
57
|
+
|
|
58
|
+
Install
|
|
59
|
+
------------------------------------------------------------------------------
|
|
60
|
+
|
|
61
|
+
``cookiecutter_pywf_open_source_demo`` is released on PyPI, so all you need is to:
|
|
62
|
+
|
|
63
|
+
.. code-block:: console
|
|
64
|
+
|
|
65
|
+
$ pip install cookiecutter-pywf-open-source-demo
|
|
66
|
+
|
|
67
|
+
To upgrade to latest version:
|
|
68
|
+
|
|
69
|
+
.. code-block:: console
|
|
70
|
+
|
|
71
|
+
$ pip install --upgrade cookiecutter-pywf-open-source-demo
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from ._version import __version__
|
|
4
|
+
from ._version import __short_description__
|
|
5
|
+
from ._version import __license__
|
|
6
|
+
from ._version import __author__
|
|
7
|
+
from ._version import __author_email__
|
|
8
|
+
from ._version import __maintainer__
|
|
9
|
+
from ._version import __maintainer_email__
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# This file is automatically generated by pywf script
|
|
3
|
+
# based on the content in pyproject.toml file
|
|
4
|
+
|
|
5
|
+
__version__ = "0.1.4"
|
|
6
|
+
__short_description__ = "An example project generated by cookiecutter-pywf_open_source."
|
|
7
|
+
__license__ = "MIT"
|
|
8
|
+
__author__ = "Sanhe Hu"
|
|
9
|
+
__author_email__ = "husanhe@gmail.com"
|
|
10
|
+
__maintainer__ = "Sanhe Hu"
|
|
11
|
+
__maintainer_email__ = "husanhe@gmail.com"
|
|
12
|
+
|
|
13
|
+
# run this script to print out the version number
|
|
14
|
+
if __name__ == "__main__": # pragma: no cover
|
|
15
|
+
print(__version__)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from functools import cached_property
|
|
5
|
+
|
|
6
|
+
_dir_here = Path(__file__).absolute().parent
|
|
7
|
+
PACKAGE_NAME = _dir_here.name
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PathEnum:
|
|
11
|
+
"""
|
|
12
|
+
Centralized enumeration of all project paths with absolute path references.
|
|
13
|
+
|
|
14
|
+
Provides IDE-autocomplete-friendly access to all project directories and files using
|
|
15
|
+
absolute paths to eliminate current directory dependencies and ensure consistent path
|
|
16
|
+
resolution across different execution contexts and DevOps workflows.
|
|
17
|
+
"""
|
|
18
|
+
@cached_property
|
|
19
|
+
def dir_home(self):
|
|
20
|
+
return Path.home()
|
|
21
|
+
|
|
22
|
+
dir_project_root = _dir_here.parent
|
|
23
|
+
dir_tmp = dir_project_root / "tmp"
|
|
24
|
+
|
|
25
|
+
# Source Code
|
|
26
|
+
dir_package = _dir_here
|
|
27
|
+
path_version_py = dir_package / "_version.py"
|
|
28
|
+
path_pyproject_toml = dir_project_root / "pyproject.toml"
|
|
29
|
+
path_requirements_txt = dir_project_root / "requirements.txt"
|
|
30
|
+
path_authors = dir_project_root / "AUTHORS.txt"
|
|
31
|
+
path_license = dir_project_root / "LICENSE.txt"
|
|
32
|
+
path_release_history = dir_project_root / "release-history.rst"
|
|
33
|
+
|
|
34
|
+
# Virtual Environment
|
|
35
|
+
dir_venv = dir_project_root / ".venv"
|
|
36
|
+
dir_venv_bin = dir_venv / "bin"
|
|
37
|
+
path_venv_bin_pip = dir_venv_bin / "pip"
|
|
38
|
+
path_venv_bin_python = dir_venv_bin / "python"
|
|
39
|
+
path_venv_bin_pytest = dir_venv_bin / "pytest"
|
|
40
|
+
|
|
41
|
+
# Test
|
|
42
|
+
dir_htmlcov = dir_project_root / "htmlcov"
|
|
43
|
+
path_cov_index_html = dir_htmlcov / "index.html"
|
|
44
|
+
dir_unit_test = dir_project_root / "tests"
|
|
45
|
+
dir_int_test = dir_project_root / "tests_int"
|
|
46
|
+
dir_load_test = dir_project_root / "tests_load"
|
|
47
|
+
|
|
48
|
+
# Documentation
|
|
49
|
+
dir_docs_source = dir_project_root / "docs" / "source"
|
|
50
|
+
dir_docs_build_html = dir_project_root / "docs" / "build" / "html"
|
|
51
|
+
|
|
52
|
+
# Build
|
|
53
|
+
dir_build = dir_project_root / "build"
|
|
54
|
+
dir_dist = dir_project_root / "dist"
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
path_enum = PathEnum()
|
|
58
|
+
"""
|
|
59
|
+
Single entry point for all project paths with absolute path references.
|
|
60
|
+
"""
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
import contextlib
|
|
6
|
+
import subprocess
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
__version__ = "0.2.1"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@contextlib.contextmanager
|
|
13
|
+
def temp_cwd(path: Path):
|
|
14
|
+
"""
|
|
15
|
+
Temporarily set the current working directory (CWD) and automatically
|
|
16
|
+
switch back when it's done.
|
|
17
|
+
"""
|
|
18
|
+
cwd = os.getcwd()
|
|
19
|
+
os.chdir(str(path))
|
|
20
|
+
try:
|
|
21
|
+
yield path
|
|
22
|
+
finally:
|
|
23
|
+
os.chdir(cwd)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def run_unit_test(
|
|
27
|
+
script: str,
|
|
28
|
+
root_dir: str,
|
|
29
|
+
):
|
|
30
|
+
"""
|
|
31
|
+
Run ``pytest -s --tb=native /path/to/script.py`` Command.
|
|
32
|
+
|
|
33
|
+
:param script: the path to test script
|
|
34
|
+
:param root_dir: the dir you want to temporarily set as cwd
|
|
35
|
+
"""
|
|
36
|
+
bin_pytest = Path(sys.executable).parent / "pytest"
|
|
37
|
+
args = [
|
|
38
|
+
f"{bin_pytest}",
|
|
39
|
+
"-s",
|
|
40
|
+
"--tb=native",
|
|
41
|
+
script,
|
|
42
|
+
]
|
|
43
|
+
with temp_cwd(Path(root_dir)):
|
|
44
|
+
subprocess.run(args)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def run_cov_test(
|
|
48
|
+
script: str,
|
|
49
|
+
module: str,
|
|
50
|
+
root_dir: str,
|
|
51
|
+
htmlcov_dir: str,
|
|
52
|
+
preview: bool = False,
|
|
53
|
+
is_folder: bool = False,
|
|
54
|
+
):
|
|
55
|
+
"""
|
|
56
|
+
The pytest-cov plugin gives you the coverage for entire project. What if
|
|
57
|
+
I want run per-module test independently and get per-module coverage?
|
|
58
|
+
|
|
59
|
+
This is a simple wrapper around pytest + coverage cli command. Allow you to run
|
|
60
|
+
coverage test from Python script and set the code coverage measurement scope.
|
|
61
|
+
|
|
62
|
+
Usage example:
|
|
63
|
+
|
|
64
|
+
suppose you have a source code folder structure like this::
|
|
65
|
+
|
|
66
|
+
/dir_git_repo/
|
|
67
|
+
/dir_git_repo/my_library
|
|
68
|
+
/dir_git_repo/my_library/__init__.py
|
|
69
|
+
/dir_git_repo/my_library/module1.py
|
|
70
|
+
/dir_git_repo/my_library/module2.py
|
|
71
|
+
|
|
72
|
+
In your module 1 unit test script, you can do this:
|
|
73
|
+
|
|
74
|
+
.. code-block:: python
|
|
75
|
+
|
|
76
|
+
from my_library.module1 import func1, func2
|
|
77
|
+
|
|
78
|
+
def test_func1():
|
|
79
|
+
pass
|
|
80
|
+
|
|
81
|
+
def test_func2():
|
|
82
|
+
pass
|
|
83
|
+
|
|
84
|
+
if __name__ == "__main__":
|
|
85
|
+
from fixa.pytest_cov_helper import run_cov_test
|
|
86
|
+
|
|
87
|
+
run_cov_test(
|
|
88
|
+
script=__file__,
|
|
89
|
+
module="my_library.module1", # test scope is the module1.py
|
|
90
|
+
root_dir="/path/to/dir_git_repo",
|
|
91
|
+
htmlcov_dir="/path/to/dir_git_repo/htmlcov",
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
In your all modules unit test script, you can do this:
|
|
95
|
+
|
|
96
|
+
.. code-block:: python
|
|
97
|
+
|
|
98
|
+
if __name__ == "__main__":
|
|
99
|
+
from fixa.pytest_cov_helper import run_cov_test
|
|
100
|
+
|
|
101
|
+
run_cov_test(
|
|
102
|
+
script=__file__,
|
|
103
|
+
module="my_library", # test scope is the my_library/
|
|
104
|
+
root_dir="/path/to/dir_git_repo",
|
|
105
|
+
htmlcov_dir="/path/to/dir_git_repo/htmlcov",
|
|
106
|
+
is_folder=True, # my_library is a folder
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
:param script: the test script absolute path
|
|
110
|
+
:param module: the dot notation to the python module you want to calculate
|
|
111
|
+
coverage
|
|
112
|
+
:param root_dir: the dir to dump coverage results binary file
|
|
113
|
+
:param htmlcov_dir: the dir to dump HTML output
|
|
114
|
+
:param preview: whether to open the HTML output in web browser after the test
|
|
115
|
+
:param is_folder: whether the module is a folder
|
|
116
|
+
|
|
117
|
+
Reference:
|
|
118
|
+
|
|
119
|
+
- https://pypi.org/project/pytest-cov/
|
|
120
|
+
"""
|
|
121
|
+
bin_pytest = Path(sys.executable).parent / "pytest"
|
|
122
|
+
if is_folder:
|
|
123
|
+
script = f"{Path(script).parent}"
|
|
124
|
+
if module.endswith(".py"): # pragma: no cover
|
|
125
|
+
module = module[:-3]
|
|
126
|
+
args = [
|
|
127
|
+
f"{bin_pytest}",
|
|
128
|
+
"-s",
|
|
129
|
+
"--tb=native",
|
|
130
|
+
f"--rootdir={root_dir}",
|
|
131
|
+
f"--cov={module}",
|
|
132
|
+
"--cov-report",
|
|
133
|
+
"term-missing",
|
|
134
|
+
"--cov-report",
|
|
135
|
+
f"html:{htmlcov_dir}",
|
|
136
|
+
script,
|
|
137
|
+
]
|
|
138
|
+
with temp_cwd(Path(root_dir)):
|
|
139
|
+
subprocess.run(args)
|
|
140
|
+
if preview: # pragma: no cover
|
|
141
|
+
platform = sys.platform
|
|
142
|
+
if platform in ["win32", "cygwin"]:
|
|
143
|
+
open_command = "start"
|
|
144
|
+
elif platform in ["darwin", "linux"]:
|
|
145
|
+
open_command = "open"
|
|
146
|
+
else:
|
|
147
|
+
raise NotImplementedError
|
|
148
|
+
subprocess.run([open_command, f"{Path(htmlcov_dir).joinpath('index.html')}"])
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cookiecutter_pywf_open_source_demo
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: An example project generated by cookiecutter-pywf_open_source.
|
|
5
|
+
Author-email: Sanhe Hu <husanhe@gmail.com>
|
|
6
|
+
Maintainer-email: Sanhe Hu <husanhe@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
9
|
+
Project-URL: Documentation, https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/
|
|
10
|
+
Project-URL: Repository, https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
11
|
+
Project-URL: Issues, https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/blob/main/release-history.rst
|
|
13
|
+
Project-URL: Download, https://pypi.org/pypi/cookiecutter-pywf-open-source-demo#files
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: MacOS
|
|
19
|
+
Classifier: Operating System :: Unix
|
|
20
|
+
Requires-Python: <4.0,>=3.10
|
|
21
|
+
Description-Content-Type: text/x-rst
|
|
22
|
+
License-File: LICENSE.txt
|
|
23
|
+
License-File: AUTHORS.rst
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: twine<7.0.0,>=6.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: wheel<1.0.0,>=0.45.0; extra == "dev"
|
|
27
|
+
Requires-Dist: build<2.0.0,>=1.2.1; extra == "dev"
|
|
28
|
+
Requires-Dist: rich<14.0.0,>=13.8.1; extra == "dev"
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: pytest<9.0.0,>=8.2.2; extra == "test"
|
|
31
|
+
Requires-Dist: pytest-cov<7.0.0,>=6.0.0; extra == "test"
|
|
32
|
+
Provides-Extra: doc
|
|
33
|
+
Requires-Dist: Sphinx<8.0.0,>=7.4.7; extra == "doc"
|
|
34
|
+
Requires-Dist: sphinx-copybutton<1.0.0,>=0.5.2; extra == "doc"
|
|
35
|
+
Requires-Dist: sphinx-design<1.0.0,>=0.6.1; extra == "doc"
|
|
36
|
+
Requires-Dist: sphinx-jinja<3.0.0,>=2.0.2; extra == "doc"
|
|
37
|
+
Requires-Dist: furo==2024.8.6; extra == "doc"
|
|
38
|
+
Requires-Dist: pygments<3.0.0,>=2.18.0; extra == "doc"
|
|
39
|
+
Requires-Dist: ipython<8.19.0,>=8.18.1; extra == "doc"
|
|
40
|
+
Requires-Dist: nbsphinx<1.0.0,>=0.8.12; extra == "doc"
|
|
41
|
+
Requires-Dist: rstobj==1.2.1; extra == "doc"
|
|
42
|
+
Requires-Dist: docfly==3.0.0; extra == "doc"
|
|
43
|
+
Provides-Extra: mise
|
|
44
|
+
Requires-Dist: PyGithub<3.0.0,>=2.8.0; extra == "mise"
|
|
45
|
+
Requires-Dist: httpx<1.0.0,>=0.28.0; extra == "mise"
|
|
46
|
+
Provides-Extra: auto
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
.. image:: https://readthedocs.org/projects/cookiecutter-pywf-open-source-demo/badge/?version=latest
|
|
51
|
+
:target: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/
|
|
52
|
+
:alt: Documentation Status
|
|
53
|
+
|
|
54
|
+
.. image:: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/actions/workflows/main.yml/badge.svg
|
|
55
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/actions?query=workflow:CI
|
|
56
|
+
|
|
57
|
+
.. image:: https://codecov.io/gh/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/branch/main/graph/badge.svg
|
|
58
|
+
:target: https://codecov.io/gh/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
59
|
+
|
|
60
|
+
.. image:: https://img.shields.io/pypi/v/cookiecutter-pywf-open-source-demo.svg
|
|
61
|
+
:target: https://pypi.python.org/pypi/cookiecutter-pywf-open-source-demo
|
|
62
|
+
|
|
63
|
+
.. image:: https://img.shields.io/pypi/l/cookiecutter-pywf-open-source-demo.svg
|
|
64
|
+
:target: https://pypi.python.org/pypi/cookiecutter-pywf-open-source-demo
|
|
65
|
+
|
|
66
|
+
.. image:: https://img.shields.io/pypi/pyversions/cookiecutter-pywf-open-source-demo.svg
|
|
67
|
+
:target: https://pypi.python.org/pypi/cookiecutter-pywf-open-source-demo
|
|
68
|
+
|
|
69
|
+
.. image:: https://img.shields.io/badge/✍️_Release_History!--None.svg?style=social&logo=github
|
|
70
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/blob/main/release-history.rst
|
|
71
|
+
|
|
72
|
+
.. image:: https://img.shields.io/badge/⭐_Star_me_on_GitHub!--None.svg?style=social&logo=github
|
|
73
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
74
|
+
|
|
75
|
+
------
|
|
76
|
+
|
|
77
|
+
.. image:: https://img.shields.io/badge/Link-API-blue.svg
|
|
78
|
+
:target: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/py-modindex.html
|
|
79
|
+
|
|
80
|
+
.. image:: https://img.shields.io/badge/Link-Install-blue.svg
|
|
81
|
+
:target: `install`_
|
|
82
|
+
|
|
83
|
+
.. image:: https://img.shields.io/badge/Link-GitHub-blue.svg
|
|
84
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project
|
|
85
|
+
|
|
86
|
+
.. image:: https://img.shields.io/badge/Link-Submit_Issue-blue.svg
|
|
87
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/issues
|
|
88
|
+
|
|
89
|
+
.. image:: https://img.shields.io/badge/Link-Request_Feature-blue.svg
|
|
90
|
+
:target: https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/issues
|
|
91
|
+
|
|
92
|
+
.. image:: https://img.shields.io/badge/Link-Download-blue.svg
|
|
93
|
+
:target: https://pypi.org/pypi/cookiecutter-pywf-open-source-demo#files
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
Welcome to ``cookiecutter_pywf_open_source_demo`` Documentation
|
|
97
|
+
==============================================================================
|
|
98
|
+
.. image:: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/_static/cookiecutter_pywf_open_source_demo-logo.png
|
|
99
|
+
:target: https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/
|
|
100
|
+
|
|
101
|
+
Documentation for ``cookiecutter_pywf_open_source_demo``.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
.. _install:
|
|
105
|
+
|
|
106
|
+
Install
|
|
107
|
+
------------------------------------------------------------------------------
|
|
108
|
+
|
|
109
|
+
``cookiecutter_pywf_open_source_demo`` is released on PyPI, so all you need is to:
|
|
110
|
+
|
|
111
|
+
.. code-block:: console
|
|
112
|
+
|
|
113
|
+
$ pip install cookiecutter-pywf-open-source-demo
|
|
114
|
+
|
|
115
|
+
To upgrade to latest version:
|
|
116
|
+
|
|
117
|
+
.. code-block:: console
|
|
118
|
+
|
|
119
|
+
$ pip install --upgrade cookiecutter-pywf-open-source-demo
|
cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo.egg-info/SOURCES.txt
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
AUTHORS.rst
|
|
2
|
+
LICENSE.txt
|
|
3
|
+
README.rst
|
|
4
|
+
pyproject.toml
|
|
5
|
+
cookiecutter_pywf_open_source_demo/__init__.py
|
|
6
|
+
cookiecutter_pywf_open_source_demo/_version.py
|
|
7
|
+
cookiecutter_pywf_open_source_demo/api.py
|
|
8
|
+
cookiecutter_pywf_open_source_demo/paths.py
|
|
9
|
+
cookiecutter_pywf_open_source_demo.egg-info/PKG-INFO
|
|
10
|
+
cookiecutter_pywf_open_source_demo.egg-info/SOURCES.txt
|
|
11
|
+
cookiecutter_pywf_open_source_demo.egg-info/dependency_links.txt
|
|
12
|
+
cookiecutter_pywf_open_source_demo.egg-info/requires.txt
|
|
13
|
+
cookiecutter_pywf_open_source_demo.egg-info/top_level.txt
|
|
14
|
+
cookiecutter_pywf_open_source_demo/vendor/__init__.py
|
|
15
|
+
cookiecutter_pywf_open_source_demo/vendor/pytest_cov_helper.py
|
|
16
|
+
tests/test_api.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo.egg-info/requires.txt
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
[auto]
|
|
3
|
+
|
|
4
|
+
[dev]
|
|
5
|
+
twine<7.0.0,>=6.0.0
|
|
6
|
+
wheel<1.0.0,>=0.45.0
|
|
7
|
+
build<2.0.0,>=1.2.1
|
|
8
|
+
rich<14.0.0,>=13.8.1
|
|
9
|
+
|
|
10
|
+
[doc]
|
|
11
|
+
Sphinx<8.0.0,>=7.4.7
|
|
12
|
+
sphinx-copybutton<1.0.0,>=0.5.2
|
|
13
|
+
sphinx-design<1.0.0,>=0.6.1
|
|
14
|
+
sphinx-jinja<3.0.0,>=2.0.2
|
|
15
|
+
furo==2024.8.6
|
|
16
|
+
pygments<3.0.0,>=2.18.0
|
|
17
|
+
ipython<8.19.0,>=8.18.1
|
|
18
|
+
nbsphinx<1.0.0,>=0.8.12
|
|
19
|
+
rstobj==1.2.1
|
|
20
|
+
docfly==3.0.0
|
|
21
|
+
|
|
22
|
+
[mise]
|
|
23
|
+
PyGithub<3.0.0,>=2.8.0
|
|
24
|
+
httpx<1.0.0,>=0.28.0
|
|
25
|
+
|
|
26
|
+
[test]
|
|
27
|
+
pytest<9.0.0,>=8.2.2
|
|
28
|
+
pytest-cov<7.0.0,>=6.0.0
|
cookiecutter_pywf_open_source_demo-1.0.0/cookiecutter_pywf_open_source_demo.egg-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cookiecutter_pywf_open_source_demo
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# The [project] table defined by Official python.org
|
|
3
|
+
#
|
|
4
|
+
# Read: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
|
|
5
|
+
# ==============================================================================
|
|
6
|
+
[project]
|
|
7
|
+
name = "cookiecutter_pywf_open_source_demo"
|
|
8
|
+
# Increment version before each release - follow `semantic versioning <https://semver.org/>`_
|
|
9
|
+
# Currently, poetry 2.1.X doesn't support dynamic versioning
|
|
10
|
+
# (Read https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#version)
|
|
11
|
+
# So this value has to be aligned with the one in ``cookiecutter_pywf_open_source_demo/_version.py``
|
|
12
|
+
version = "1.0.0"
|
|
13
|
+
description = "An example project generated by cookiecutter-pywf_open_source."
|
|
14
|
+
# Read https://dev-exp-share.readthedocs.io/en/latest/search.html?q=Pick+An+Open+Source+License+For+Python+Project&check_keywords=yes&area=default
|
|
15
|
+
# To pick a license and update the ``license``, ``classifier`` field in ``pyproject.toml``
|
|
16
|
+
# And also update the ``LICENSE.txt`` file in the git repo.
|
|
17
|
+
license = "MIT"
|
|
18
|
+
license-files = ["LICENSE.txt", "AUTHORS.rst"]
|
|
19
|
+
authors = [
|
|
20
|
+
{ name = "Sanhe Hu", email = "husanhe@gmail.com" },
|
|
21
|
+
]
|
|
22
|
+
maintainers = [
|
|
23
|
+
{ name = "Sanhe Hu", email = "husanhe@gmail.com" },
|
|
24
|
+
]
|
|
25
|
+
keywords = []
|
|
26
|
+
readme = "README.rst"
|
|
27
|
+
requires-python = ">=3.10,<4.0"
|
|
28
|
+
# Full list of classifiers: https://pypi.org/classifiers/
|
|
29
|
+
classifiers = [
|
|
30
|
+
"Development Status :: 4 - Beta",
|
|
31
|
+
"Intended Audience :: Developers",
|
|
32
|
+
"Natural Language :: English",
|
|
33
|
+
"Operating System :: Microsoft :: Windows",
|
|
34
|
+
"Operating System :: MacOS",
|
|
35
|
+
"Operating System :: Unix",
|
|
36
|
+
# Note: classfier like "Programming Language :: Python :: 3 :: Only",
|
|
37
|
+
# "Programming Language :: Python :: 3.X" is no longer needed,
|
|
38
|
+
# because we have ``requires-python`` field.
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
# ------------------------------------------------------------------------------
|
|
42
|
+
# Core Dependencies
|
|
43
|
+
# ------------------------------------------------------------------------------
|
|
44
|
+
dependencies = [
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
# ------------------------------------------------------------------------------
|
|
48
|
+
# Optional dependency that can be used in ``pip install ${your_project_name}[${feature_name}]``
|
|
49
|
+
# Sometime this is also called "extras"
|
|
50
|
+
# Read: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#dependencies-optional-dependencies
|
|
51
|
+
#
|
|
52
|
+
# IMPORTANT: all optional dependencies has to be compatible with the "requires-python" field
|
|
53
|
+
# ------------------------------------------------------------------------------
|
|
54
|
+
[project.optional-dependencies]
|
|
55
|
+
|
|
56
|
+
# ------------------------------------------------------------------------------
|
|
57
|
+
# Local Development dependenceies
|
|
58
|
+
# ------------------------------------------------------------------------------
|
|
59
|
+
dev = [
|
|
60
|
+
"twine>=6.0.0,<7.0.0", # distribute package to PyPI
|
|
61
|
+
"wheel>=0.45.0,<1.0.0", # build wheel package
|
|
62
|
+
"build>=1.2.1,<2.0.0", # build source distribution
|
|
63
|
+
"rich>=13.8.1,<14.0.0", # pretty print
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
# ------------------------------------------------------------------------------
|
|
67
|
+
# (Unit/Coverage/Integration/Load) Test dependenceies
|
|
68
|
+
# ------------------------------------------------------------------------------
|
|
69
|
+
test = [
|
|
70
|
+
"pytest>=8.2.2,<9.0.0", # Testing framework
|
|
71
|
+
"pytest-cov>=6.0.0,<7.0.0", # Coverage reporting
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
# ------------------------------------------------------------------------------
|
|
75
|
+
# Documentation build dependenceies
|
|
76
|
+
# ------------------------------------------------------------------------------
|
|
77
|
+
doc = [
|
|
78
|
+
"Sphinx>=7.4.7,<8.0.0",
|
|
79
|
+
"sphinx-copybutton>=0.5.2,<1.0.0", # add copy button to code block
|
|
80
|
+
"sphinx-design>=0.6.1,<1.0.0", # add additional design pattern to sphinx
|
|
81
|
+
"sphinx-jinja>=2.0.2,<3.0.0", # enable jinja syntax in reStructuredText
|
|
82
|
+
"furo==2024.8.6", # the furo sphinx theme
|
|
83
|
+
"pygments>=2.18.0,<3.0.0", # syntax highlight
|
|
84
|
+
"ipython>=8.18.1,<8.19.0", # interactive Python
|
|
85
|
+
"nbsphinx>=0.8.12,<1.0.0", # add jupyter notebook in sphinx doc
|
|
86
|
+
"rstobj==1.2.1", # generate reStructuredText from Python code
|
|
87
|
+
"docfly==3.0.0", # automaticall generate .. toctree directives and API reference doc
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
# ------------------------------------------------------------------------------
|
|
91
|
+
# Mise task runner dependencies
|
|
92
|
+
# ------------------------------------------------------------------------------
|
|
93
|
+
mise = [
|
|
94
|
+
"PyGithub>=2.8.0,<3.0.0", # GitHub API client
|
|
95
|
+
"httpx>=0.28.0,<1.0.0", # HTTP client for ReadTheDocs API
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
# ------------------------------------------------------------------------------
|
|
99
|
+
# Automation (devops) dependenceies
|
|
100
|
+
# ------------------------------------------------------------------------------
|
|
101
|
+
auto = [
|
|
102
|
+
]
|
|
103
|
+
|
|
104
|
+
# Quick Links
|
|
105
|
+
[project.urls]
|
|
106
|
+
Homepage = "https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project"
|
|
107
|
+
Documentation = "https://cookiecutter-pywf-open-source-demo.readthedocs.io/en/latest/"
|
|
108
|
+
Repository = "https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project"
|
|
109
|
+
Issues = "https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/issues"
|
|
110
|
+
Changelog = "https://github.com/MacHu-GWU/cookiecutter_pywf_open_source_demo-project/blob/main/release-history.rst"
|
|
111
|
+
Download = "https://pypi.org/pypi/cookiecutter-pywf-open-source-demo#files"
|
|
112
|
+
|
|
113
|
+
# For command line interface, read: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#creating-executable-scripts
|
|
114
|
+
[project.scripts]
|
|
115
|
+
|
|
116
|
+
[tool.poetry.requires-plugins]
|
|
117
|
+
poetry-plugin-export = ">=1.9.0,<2.0.0"
|
|
118
|
+
|
|
119
|
+
[tool.poetry]
|
|
120
|
+
# Files to include in the package distribution
|
|
121
|
+
packages = [
|
|
122
|
+
{ include = "cookiecutter_pywf_open_source_demo", from = ".", to = "." }
|
|
123
|
+
]
|
|
124
|
+
# Files to exclude from the package
|
|
125
|
+
exclude = [
|
|
126
|
+
"cookiecutter_pywf_open_source_demo/tests/*",
|
|
127
|
+
"cookiecutter_pywf_open_source_demo/docs/*",
|
|
128
|
+
"**/*.pyc",
|
|
129
|
+
"**/*.pyo",
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
## python workflow tool config
|
|
133
|
+
#[tool.pywf]
|
|
134
|
+
## The specific python version you use for local development
|
|
135
|
+
#dev_python = "3.12.11"
|
|
136
|
+
## --- github.com
|
|
137
|
+
#github_account = "MacHu-GWU"
|
|
138
|
+
## Create GitHub token in https://github.com/settings/tokens and put the token in
|
|
139
|
+
## ``${HOME}/home_secret.json``
|
|
140
|
+
#github_token_field = "providers.github.accounts.sh.users.sh.secrets.dev.value"
|
|
141
|
+
## --- codecov.io (for code coverage test report)
|
|
142
|
+
#codecov_account = "MacHu-GWU"
|
|
143
|
+
## Create Codecov token in https://app.codecov.io/account/gh/${codecov_account}/access
|
|
144
|
+
## and put the token in ``${HOME}/home_secret.json``
|
|
145
|
+
#codecov_token_field = "providers.codecov_io.accounts.sh.users.sh.secrets.dev.value"
|
|
146
|
+
## --- readthedocs.org (for documentation hosting)
|
|
147
|
+
## Create Readthedocs token in https://app.readthedocs.org/accounts/tokens/
|
|
148
|
+
## and put the token at ``${HOME}/home_secret.json``
|
|
149
|
+
#readthedocs_token_field = "providers.readthedocs.accounts.sh.users.sh.secrets.dev.value"
|
|
150
|
+
## Readthedocs project name, usually it is the same as your project name
|
|
151
|
+
#readthedocs_project_name = "cookiecutter_pywf_open_source_demo"
|
|
152
|
+
|
|
153
|
+
[tool.setuptools.packages.find]
|
|
154
|
+
where = ["."]
|
|
155
|
+
include = ["cookiecutter_pywf_open_source_demo*"]
|
|
156
|
+
exclude = [
|
|
157
|
+
"cookiecutter_pywf_open_source_demo.tests",
|
|
158
|
+
"cookiecutter_pywf_open_source_demo.tests.*",
|
|
159
|
+
"cookiecutter_pywf_open_source_demo.docs",
|
|
160
|
+
"cookiecutter_pywf_open_source_demo.docs.*",
|
|
161
|
+
]
|
|
162
|
+
|
|
163
|
+
[build-system]
|
|
164
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
165
|
+
build-backend = "setuptools.build_meta"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from cookiecutter_pywf_open_source_demo import api
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test():
|
|
7
|
+
_ = api
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
if __name__ == "__main__":
|
|
11
|
+
from cookiecutter_pywf_open_source_demo.tests import run_cov_test
|
|
12
|
+
|
|
13
|
+
run_cov_test(
|
|
14
|
+
__file__,
|
|
15
|
+
"cookiecutter_pywf_open_source_demo.api",
|
|
16
|
+
preview=False,
|
|
17
|
+
)
|