jupyter-analysis-tools 1.3.0__tar.gz → 1.3.1__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 (60) hide show
  1. jupyter_analysis_tools-1.3.1/.copier-answers.yml +25 -0
  2. jupyter_analysis_tools-1.3.1/AUTHORS.rst +6 -0
  3. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/CHANGELOG.md +38 -0
  4. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/LICENSE +1 -1
  5. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/MANIFEST.in +2 -2
  6. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/PKG-INFO +43 -6
  7. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/README.rst +2 -2
  8. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/ci/requirements.txt +1 -0
  9. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/conf.py +11 -4
  10. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/pyproject.toml +10 -4
  11. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools/__init__.py +1 -1
  12. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools.egg-info/PKG-INFO +43 -6
  13. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools.egg-info/SOURCES.txt +1 -8
  14. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/tests/requirements.txt +1 -0
  15. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/tox.ini +10 -15
  16. jupyter_analysis_tools-1.3.0/.cookiecutterrc +0 -27
  17. jupyter_analysis_tools-1.3.0/AUTHORS.rst +0 -6
  18. jupyter_analysis_tools-1.3.0/ci/templates/.github/workflows/build.yml +0 -61
  19. jupyter_analysis_tools-1.3.0/ci/templates/.github/workflows/ci-cd.yml +0 -69
  20. jupyter_analysis_tools-1.3.0/ci/templates/.github/workflows/coverage.yml +0 -132
  21. jupyter_analysis_tools-1.3.0/ci/templates/.github/workflows/docs.yml +0 -37
  22. jupyter_analysis_tools-1.3.0/ci/templates/.github/workflows/release.yml +0 -39
  23. jupyter_analysis_tools-1.3.0/ci/templates/.github/workflows/tests.yml +0 -58
  24. jupyter_analysis_tools-1.3.0/ci/update.py +0 -125
  25. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/.editorconfig +0 -0
  26. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/.pre-commit-config.yaml +0 -0
  27. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/CONTRIBUTING.rst +0 -0
  28. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/_templates/class.rst +0 -0
  29. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/_templates/module.rst +0 -0
  30. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/authors.rst +0 -0
  31. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/changelog.rst +0 -0
  32. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/contributing.rst +0 -0
  33. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/index.rst +0 -0
  34. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/installation.rst +0 -0
  35. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/readme.rst +0 -0
  36. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/reference/index.rst +0 -0
  37. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/requirements.txt +0 -0
  38. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/spelling_wordlist.txt +0 -0
  39. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/docs/usage.rst +0 -0
  40. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/setup.cfg +0 -0
  41. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools/analysis.py +0 -0
  42. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools/binning.py +0 -0
  43. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools/datalocations.py +0 -0
  44. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools/distrib.py +0 -0
  45. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools/git.py +0 -0
  46. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools/plotting.py +0 -0
  47. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools/readdata.py +0 -0
  48. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools/utils.py +0 -0
  49. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools/widgets.py +0 -0
  50. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools.egg-info/dependency_links.txt +0 -0
  51. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools.egg-info/requires.txt +0 -0
  52. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/src/jupyter_analysis_tools.egg-info/top_level.txt +0 -0
  53. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/templates/CHANGELOG.md.j2 +0 -0
  54. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/testdata/2015-03-20-Silica.ssf.json +0 -0
  55. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/testdata/2015-03-20-Silica.ssfz +0 -0
  56. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/testdata/S2842 water.json +0 -0
  57. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/testdata/S2842 water.pdh +0 -0
  58. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/testdata/S2843[9].pdh +0 -0
  59. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/tests/readdata.py +0 -0
  60. {jupyter_analysis_tools-1.3.0 → jupyter_analysis_tools-1.3.1}/tests/utils.py +0 -0
@@ -0,0 +1,25 @@
1
+ # Changes here will be overwritten by Copier
2
+ _commit: cc8ce84
3
+ _src_path: ~/code/yapy-copier-template
4
+ author_count: 2
5
+ author_emails: ingo.bressler@bam.de, brian.pauw@bam.de
6
+ author_names: Ingo Breßler, Brian R. Pauw
7
+ author_websites: https://github.com/ibresslerBAM, https://lookingatnothing.com
8
+ copyright_from: 2018
9
+ docs_url: https://BAMresearch.github.io/jupyter-analysis-tools
10
+ license: MIT
11
+ project_description: Yet another Python library with helpers and utilities for data
12
+ analysis and processing.
13
+ project_name: Jupyter Analysis Tools
14
+ pypi_host: pypi.org
15
+ python_versions:
16
+ - '3.11'
17
+ - '3.12'
18
+ - '3.13'
19
+ release_date_question: today
20
+ repo_hosting_domain: github.com
21
+ repo_main_branch: main
22
+ repo_name: jupyter-analysis-tools
23
+ repo_userorg: BAMresearch
24
+ sphinx_theme: furo
25
+ version: 1.3.1
@@ -0,0 +1,6 @@
1
+
2
+ Authors
3
+ =======
4
+
5
+ * Ingo Breßler - ingo.bressler@bam.de
6
+ * Brian R. Pauw - brian.pauw@bam.de
@@ -1,5 +1,43 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.3.1 (2025-07-23)
4
+
5
+ ### Bug fixes
6
+
7
+ * Project: update manifest and flake8 config, reapplied template ([`c98c648`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/c98c6489423a45d8a195fda32396ea9d9d18b9eb))
8
+
9
+ ### Code style
10
+
11
+ * utils: satisfy flake8 ([`2e3dc36`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/2e3dc36ef21e60f4fe7b8caea567411cc69967c0))
12
+
13
+ ### Continuous integration
14
+
15
+ * semantic-release: replace .cookiecutterrc by .copier-answers.yml ([`2030c88`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/2030c88dfb0ca69ac332380e33b3baed9cb6cf44))
16
+
17
+ * coverage: coverage-report fix ([`1bd26b7`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1bd26b71abcb090ef32cb2fbdd05b978bce5144c))
18
+
19
+ * GitHub Workflows: remove templates, rendered by *copier update* ([`8a637a5`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/8a637a5b34df4a3ec6a4e8cae97a9d3e24ad2e5c))
20
+
21
+ * GitHub Workflow: publish depends on all other job to be successful ([`efc1f22`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/efc1f223aa2da882d43b27406a2f20113c2c8879))
22
+
23
+ * Template: latest GitHub Workflow templates applied ([`7d87906`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/7d87906c852cb2b57704c45db0b19c7a1ae513a2))
24
+
25
+ * coverage: fix path name matching rules ([`37bd2d9`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/37bd2d93a8fe10a3355feee6779f45bd9161a88b))
26
+
27
+ ### Documentation
28
+
29
+ * Copyright years: update ([`cee35e6`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/cee35e6fe92ae27575bd7fb4a7a2638cd1c931b2))
30
+
31
+ * Contributions: Authors update ([`dd5a5c4`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/dd5a5c4d81732821057bcc200f462159cffa760b))
32
+
33
+ ### Refactoring
34
+
35
+ * Project: GitHub Workflow templates fixed ([`b346b28`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/b346b282332f0f7f81b724509a4004e6a69d7791))
36
+
37
+ * Project: GitHub Workflow templates updated ([`235c4d9`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/235c4d9c53997fdf4c08913361fb57167939cd7c))
38
+
39
+ * Project: switching to copier for project template with update mechanism ([`0d3064b`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/0d3064b8cef45667b0964aab248b583424946207))
40
+
3
41
  ## v1.3.0 (2025-07-16)
4
42
 
5
43
  ### Bug fixes
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018-2023, Ingo Breßler
3
+ Copyright (c) 2018-2025, Ingo Breßler and Brian R. Pauw
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -3,10 +3,11 @@ exclude docs/reference/autosummary/*
3
3
  graft src
4
4
  graft ci
5
5
  graft tests
6
+ graft testdata
6
7
 
7
8
  include .editorconfig
8
9
  include .pre-commit-config.yaml
9
- include .cookiecutterrc
10
+ include .copier-answers.yml
10
11
  include tox.ini
11
12
 
12
13
  include AUTHORS.rst
@@ -17,4 +18,3 @@ include README.rst
17
18
 
18
19
  global-exclude *.py[cod] __pycache__/* *.so *.dylib .DS_Store */.ipynb_checkpoints/*
19
20
  recursive-include templates *.j2
20
- recursive-include testdata *.pdh *.ssfz *.json
@@ -1,15 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Yet another Python library with helpers and utilities for data analysis and processing.
5
- Author-email: Ingo Breßler <dev@ingobressler.net>
6
- License: MIT license
5
+ Author-email: Ingo Breßler <ingo.bressler@bam.de>, "Brian R. Pauw" <brian.pauw@bam.de>
6
+ License-Expression: MIT
7
7
  Project-URL: homepage, https://BAMresearch.github.io/jupyter-analysis-tools
8
8
  Project-URL: documentation, https://BAMresearch.github.io/jupyter-analysis-tools
9
9
  Project-URL: repository, https://github.com/BAMresearch/jupyter-analysis-tools
10
10
  Project-URL: changelog, https://BAMresearch.github.io/jupyter-analysis-tools/changelog.html
11
11
  Classifier: Development Status :: 4 - Beta
12
- Classifier: License :: OSI Approved :: MIT License
13
12
  Classifier: Operating System :: Unix
14
13
  Classifier: Operating System :: POSIX
15
14
  Classifier: Operating System :: MacOS
@@ -53,8 +52,8 @@ Yet another Python library with helpers and utilities for data analysis and proc
53
52
  :target: https://pypi.org/project/jupyter-analysis-tools
54
53
  :alt: PyPI Package latest release
55
54
 
56
- .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.3.0.svg
57
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.3.0...main
55
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.3.1.svg
56
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.3.1...main
58
57
  :alt: Commits since latest release
59
58
 
60
59
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -127,6 +126,44 @@ Note, to combine the coverage data from all the tox environments run:
127
126
 
128
127
  # CHANGELOG
129
128
 
129
+ ## v1.3.1 (2025-07-23)
130
+
131
+ ### Bug fixes
132
+
133
+ * Project: update manifest and flake8 config, reapplied template ([`c98c648`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/c98c6489423a45d8a195fda32396ea9d9d18b9eb))
134
+
135
+ ### Code style
136
+
137
+ * utils: satisfy flake8 ([`2e3dc36`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/2e3dc36ef21e60f4fe7b8caea567411cc69967c0))
138
+
139
+ ### Continuous integration
140
+
141
+ * semantic-release: replace .cookiecutterrc by .copier-answers.yml ([`2030c88`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/2030c88dfb0ca69ac332380e33b3baed9cb6cf44))
142
+
143
+ * coverage: coverage-report fix ([`1bd26b7`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1bd26b71abcb090ef32cb2fbdd05b978bce5144c))
144
+
145
+ * GitHub Workflows: remove templates, rendered by *copier update* ([`8a637a5`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/8a637a5b34df4a3ec6a4e8cae97a9d3e24ad2e5c))
146
+
147
+ * GitHub Workflow: publish depends on all other job to be successful ([`efc1f22`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/efc1f223aa2da882d43b27406a2f20113c2c8879))
148
+
149
+ * Template: latest GitHub Workflow templates applied ([`7d87906`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/7d87906c852cb2b57704c45db0b19c7a1ae513a2))
150
+
151
+ * coverage: fix path name matching rules ([`37bd2d9`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/37bd2d93a8fe10a3355feee6779f45bd9161a88b))
152
+
153
+ ### Documentation
154
+
155
+ * Copyright years: update ([`cee35e6`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/cee35e6fe92ae27575bd7fb4a7a2638cd1c931b2))
156
+
157
+ * Contributions: Authors update ([`dd5a5c4`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/dd5a5c4d81732821057bcc200f462159cffa760b))
158
+
159
+ ### Refactoring
160
+
161
+ * Project: GitHub Workflow templates fixed ([`b346b28`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/b346b282332f0f7f81b724509a4004e6a69d7791))
162
+
163
+ * Project: GitHub Workflow templates updated ([`235c4d9`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/235c4d9c53997fdf4c08913361fb57167939cd7c))
164
+
165
+ * Project: switching to copier for project template with update mechanism ([`0d3064b`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/0d3064b8cef45667b0964aab248b583424946207))
166
+
130
167
  ## v1.3.0 (2025-07-16)
131
168
 
132
169
  ### Bug fixes
@@ -14,8 +14,8 @@ Yet another Python library with helpers and utilities for data analysis and proc
14
14
  :target: https://pypi.org/project/jupyter-analysis-tools
15
15
  :alt: PyPI Package latest release
16
16
 
17
- .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.3.0.svg
18
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.3.0...main
17
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.3.1.svg
18
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.3.1...main
19
19
  :alt: Commits since latest release
20
20
 
21
21
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -5,6 +5,7 @@ six>=1.14.0
5
5
  tox
6
6
  build
7
7
  twine
8
+ toml
8
9
  python-semantic-release
9
10
  # provides the *coverage* command to combine and publish coverage data
10
11
  # generated within tox environments
@@ -19,17 +19,20 @@ extensions = [
19
19
  "sphinx.ext.napoleon",
20
20
  "sphinx.ext.todo",
21
21
  "sphinx.ext.viewcode",
22
+ "sphinx.ext.inheritance_diagram",
23
+ "sphinx.ext.graphviz",
22
24
  "myst_parser",
23
25
  ]
26
+ inheritance_edge_attrs = dict(color="gray") # readable in darkmode too
24
27
  autosummary_generate = True # Turn on sphinx.ext.autosummary
25
28
  templates_path = ["_templates"]
26
29
  source_suffix = ".rst"
27
30
  master_doc = "index"
28
31
  project = "Jupyter Analysis Tools"
29
- year = "2018-2023"
30
- author = "Ingo Breßler"
32
+ year = "2018-2025"
33
+ author = "Ingo Breßler and Brian R. Pauw"
31
34
  copyright = "{0}, {1}".format(year, author)
32
- version = "1.3.0"
35
+ version = "1.3.1"
33
36
  release = version
34
37
  commit_id = None
35
38
  try:
@@ -42,6 +45,7 @@ except subprocess.CalledProcessError as e:
42
45
 
43
46
  autodoc_mock_imports = [
44
47
  "ipykernel",
48
+ "notebook",
45
49
  "pandas",
46
50
  "ipywidgets",
47
51
  "matplotlib",
@@ -49,6 +53,9 @@ autodoc_mock_imports = [
49
53
  "h5py",
50
54
  "pint",
51
55
  "sasmodels",
56
+ "chempy",
57
+ "graphviz",
58
+ "mcsas3",
52
59
  ]
53
60
 
54
61
  pygments_style = "trac"
@@ -78,7 +85,7 @@ linkcheck_ignore = [
78
85
  + r".*",
79
86
  # attempted fix of '406 Client Error: Not Acceptable for url'
80
87
  # https://github.com/sphinx-doc/sphinx/issues/1331
81
- join(project_meta["project"]["urls"]["repository"], "commit", r"[0-9a-fA-F]+"),
88
+ join(project_meta["project"]["urls"]["repository"], "commit", r"[0-9a-fA-F]+")
82
89
  ]
83
90
  linkcheck_anchors_ignore_for_url = [
84
91
  r"https://pypi\.org/project/[^/]+",
@@ -1,13 +1,11 @@
1
1
  [project]
2
2
  name = "jupyter-analysis-tools"
3
3
  description = "Yet another Python library with helpers and utilities for data analysis and processing."
4
- authors = [{ name = "Ingo Breßler", email = "dev@ingobressler.net" }]
5
4
  dynamic = ["version", "readme"]
6
- license = {text = "MIT license"}
5
+ license = "MIT"
7
6
  classifiers = [
8
7
  # complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
9
8
  "Development Status :: 4 - Beta",
10
- "License :: OSI Approved :: MIT License",
11
9
  "Operating System :: Unix",
12
10
  "Operating System :: POSIX",
13
11
  "Operating System :: MacOS",
@@ -30,6 +28,14 @@ dependencies = [
30
28
  "numpy", "scipy", "pandas", "matplotlib", "ipywidgets"
31
29
  ]
32
30
 
31
+ [[project.authors]]
32
+ name = "Ingo Breßler"
33
+ email = "ingo.bressler@bam.de"
34
+
35
+ [[project.authors]]
36
+ name = "Brian R. Pauw"
37
+ email = "brian.pauw@bam.de"
38
+
33
39
  [project.urls]
34
40
  homepage = "https://BAMresearch.github.io/jupyter-analysis-tools"
35
41
  documentation = "https://BAMresearch.github.io/jupyter-analysis-tools"
@@ -53,7 +59,7 @@ version = {attr = "jupyter_analysis_tools.__version__"}
53
59
  readme = {file = ["README.rst", "CHANGELOG.md"]}
54
60
 
55
61
  [tool.coverage.report]
56
- path = "coverage-report"
62
+ path = "coverage-report" # see coverage.yml github action
57
63
 
58
64
  # on version numbers: https://peps.python.org/pep-0440/
59
65
  # and bottom of https://softwareengineering.stackexchange.com/a/151558
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # __init__.py
3
3
 
4
- __version__ = "1.3.0"
4
+ __version__ = "1.3.1"
5
5
 
6
6
  from .binning import reBin
7
7
  from .git import checkRepo, isNBstripoutActivated, isNBstripoutInstalled, isRepo
@@ -1,15 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jupyter-analysis-tools
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Yet another Python library with helpers and utilities for data analysis and processing.
5
- Author-email: Ingo Breßler <dev@ingobressler.net>
6
- License: MIT license
5
+ Author-email: Ingo Breßler <ingo.bressler@bam.de>, "Brian R. Pauw" <brian.pauw@bam.de>
6
+ License-Expression: MIT
7
7
  Project-URL: homepage, https://BAMresearch.github.io/jupyter-analysis-tools
8
8
  Project-URL: documentation, https://BAMresearch.github.io/jupyter-analysis-tools
9
9
  Project-URL: repository, https://github.com/BAMresearch/jupyter-analysis-tools
10
10
  Project-URL: changelog, https://BAMresearch.github.io/jupyter-analysis-tools/changelog.html
11
11
  Classifier: Development Status :: 4 - Beta
12
- Classifier: License :: OSI Approved :: MIT License
13
12
  Classifier: Operating System :: Unix
14
13
  Classifier: Operating System :: POSIX
15
14
  Classifier: Operating System :: MacOS
@@ -53,8 +52,8 @@ Yet another Python library with helpers and utilities for data analysis and proc
53
52
  :target: https://pypi.org/project/jupyter-analysis-tools
54
53
  :alt: PyPI Package latest release
55
54
 
56
- .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.3.0.svg
57
- :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.3.0...main
55
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/BAMresearch/jupyter-analysis-tools/v1.3.1.svg
56
+ :target: https://github.com/BAMresearch/jupyter-analysis-tools/compare/v1.3.1...main
58
57
  :alt: Commits since latest release
59
58
 
60
59
  .. |license| image:: https://img.shields.io/pypi/l/jupyter-analysis-tools.svg
@@ -127,6 +126,44 @@ Note, to combine the coverage data from all the tox environments run:
127
126
 
128
127
  # CHANGELOG
129
128
 
129
+ ## v1.3.1 (2025-07-23)
130
+
131
+ ### Bug fixes
132
+
133
+ * Project: update manifest and flake8 config, reapplied template ([`c98c648`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/c98c6489423a45d8a195fda32396ea9d9d18b9eb))
134
+
135
+ ### Code style
136
+
137
+ * utils: satisfy flake8 ([`2e3dc36`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/2e3dc36ef21e60f4fe7b8caea567411cc69967c0))
138
+
139
+ ### Continuous integration
140
+
141
+ * semantic-release: replace .cookiecutterrc by .copier-answers.yml ([`2030c88`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/2030c88dfb0ca69ac332380e33b3baed9cb6cf44))
142
+
143
+ * coverage: coverage-report fix ([`1bd26b7`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/1bd26b71abcb090ef32cb2fbdd05b978bce5144c))
144
+
145
+ * GitHub Workflows: remove templates, rendered by *copier update* ([`8a637a5`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/8a637a5b34df4a3ec6a4e8cae97a9d3e24ad2e5c))
146
+
147
+ * GitHub Workflow: publish depends on all other job to be successful ([`efc1f22`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/efc1f223aa2da882d43b27406a2f20113c2c8879))
148
+
149
+ * Template: latest GitHub Workflow templates applied ([`7d87906`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/7d87906c852cb2b57704c45db0b19c7a1ae513a2))
150
+
151
+ * coverage: fix path name matching rules ([`37bd2d9`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/37bd2d93a8fe10a3355feee6779f45bd9161a88b))
152
+
153
+ ### Documentation
154
+
155
+ * Copyright years: update ([`cee35e6`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/cee35e6fe92ae27575bd7fb4a7a2638cd1c931b2))
156
+
157
+ * Contributions: Authors update ([`dd5a5c4`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/dd5a5c4d81732821057bcc200f462159cffa760b))
158
+
159
+ ### Refactoring
160
+
161
+ * Project: GitHub Workflow templates fixed ([`b346b28`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/b346b282332f0f7f81b724509a4004e6a69d7791))
162
+
163
+ * Project: GitHub Workflow templates updated ([`235c4d9`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/235c4d9c53997fdf4c08913361fb57167939cd7c))
164
+
165
+ * Project: switching to copier for project template with update mechanism ([`0d3064b`](https://github.com/BAMresearch/jupyter-analysis-tools/commit/0d3064b8cef45667b0964aab248b583424946207))
166
+
130
167
  ## v1.3.0 (2025-07-16)
131
168
 
132
169
  ### Bug fixes
@@ -1,4 +1,4 @@
1
- .cookiecutterrc
1
+ .copier-answers.yml
2
2
  .editorconfig
3
3
  .pre-commit-config.yaml
4
4
  AUTHORS.rst
@@ -10,13 +10,6 @@ README.rst
10
10
  pyproject.toml
11
11
  tox.ini
12
12
  ci/requirements.txt
13
- ci/update.py
14
- ci/templates/.github/workflows/build.yml
15
- ci/templates/.github/workflows/ci-cd.yml
16
- ci/templates/.github/workflows/coverage.yml
17
- ci/templates/.github/workflows/docs.yml
18
- ci/templates/.github/workflows/release.yml
19
- ci/templates/.github/workflows/tests.yml
20
13
  docs/authors.rst
21
14
  docs/changelog.rst
22
15
  docs/conf.py
@@ -1,4 +1,5 @@
1
1
  ipykernel
2
+ notebook
2
3
  pandas
3
4
  ipywidgets
4
5
  matplotlib
@@ -1,14 +1,3 @@
1
- # on updates run 'python3 ci/update.py --no-env' to generate tests.yml github workflows
2
- [testenv:bootstrap]
3
- deps =
4
- jinja2
5
- tox
6
- toml
7
- pyyaml
8
- skip_install = true
9
- commands =
10
- python ci/update.py --no-env
11
-
12
1
  [tox]
13
2
  envlist =
14
3
  clean,
@@ -30,6 +19,9 @@ basepython =
30
19
  setenv =
31
20
  PYTHONPATH={toxinidir}/tests
32
21
  PYTHONUNBUFFERED=yes
22
+ # fix wrong cp1252 on Windows when loading a notebook with dash (or other unicode symbols)
23
+ # since locale.getpreferredencoding can't be changed easily
24
+ PYTHONUTF8=1
33
25
  deps =
34
26
  pytest
35
27
  pytest-cov
@@ -82,7 +74,7 @@ commands =
82
74
  deps =
83
75
  coverage
84
76
  skip_install = true
85
- allowlist_externals=/bin/rm,/usr/bin/rm,rm
77
+ allowlist_externals=/bin/rm,/usr/bin/rm
86
78
  commands =
87
79
  coverage erase
88
80
  rm -Rf dist build htmlcov src/jupyter_analysis_tools.egg-info
@@ -122,7 +114,10 @@ testpaths =
122
114
  notebooks
123
115
  # Idea from: https://til.simonwillison.net/pytest/treat-warnings-as-errors
124
116
  filterwarnings =
125
- ignore::DeprecationWarning:distutils|notebook|_pytest|xarray|nbclient|pytest_notebook|debugpy|pkg_resources
117
+ ignore::DeprecationWarning:distutils|notebook|_pytest|xarray|nbclient|pytest_notebook|debugpy
118
+ ignore::DeprecationWarning:pkg_resources|openpyxl|zmq
119
+ # ignore warnings about unknown pytest-notebook options below
120
+ ignore::Warning:_pytest
126
121
  nb_test_files = True
127
122
  nb_coverage = False
128
123
  nb_post_processors =
@@ -139,10 +134,10 @@ nb_diff_ignore =
139
134
  [coverage:paths]
140
135
  src =
141
136
  src
142
- */jupyter_analysis_tools/jupyter_analysis_tools/src
137
+ */jupyter-analysis-tools/jupyter-analysis-tools/src
143
138
  tests =
144
139
  tests
145
- */jupyter_analysis_tools/jupyter_analysis_tools/tests
140
+ */jupyter-analysis-tools/jupyter-analysis-tools/tests
146
141
 
147
142
  [coverage:run]
148
143
  branch = true
@@ -1,27 +0,0 @@
1
- # This file exists so you can easily regenerate your project.
2
- # run:
3
- #
4
- # cookiecutter --overwrite-if-exists --config-file=.cookiecutterrc gh:BAMresearch/yapy-cookiecutter
5
-
6
- default_context:
7
- full_name: 'Ingo Breßler'
8
- email: 'dev@ingobressler.net'
9
- website: 'https://github.com/ibressler'
10
- project_name: 'Jupyter Analysis Tools'
11
- repo_name: 'jupyter-analysis-tools'
12
- repo_hosting: 'github.com'
13
- repo_hosting_domain: 'github.com'
14
- repo_userorg: 'BAMresearch'
15
- docs_url: 'https://BAMresearch.github.io/jupyter-analysis-tools'
16
- repo_main_branch: 'main'
17
- package_name: 'jupyter_analysis_tools'
18
- distribution_name: 'jupyter-analysis-tools'
19
- project_short_description: 'Yet another Python library with helpers and utilities for data analysis and processing.'
20
- release_date: 'today'
21
- year_from: '2018'
22
- year_to: '2023'
23
- version: '1.3.0'
24
- pypi_host: 'pypi.org'
25
- license: 'MIT license'
26
- sphinx_theme: 'furo'
27
- extra_context: {'exclude_existing': "['AUTHORS.rst', 'CHANGELOG.md', 'src/jupyter_analysis_tools/__init__.py']"}
@@ -1,6 +0,0 @@
1
-
2
- Authors
3
- =======
4
-
5
- * Ingo Breßler - dev <at> ingobressler.net
6
- * Brian R. Pauw - brian <at> stack.nl
@@ -1,61 +0,0 @@
1
- name: Build
2
-
3
- # Controls when the action will run.
4
- on:
5
- workflow_call:
6
-
7
- {% import '.github/workflows/ci-cd.yml' as ci with context %}{# Use some Jinja macros -#}
8
-
9
- jobs:
10
- build:
11
- # convert this to a matrix if builds differ between platforms
12
- runs-on: {{'${{ matrix.os }}'}}
13
- strategy:
14
- matrix:
15
- os: ['ubuntu-latest']
16
- steps:
17
-
18
- {{ ci.checkout() }}
19
- with:
20
- ref: main
21
-
22
- {{ ci.setup_python() }}
23
-
24
- {{ ci.pip_install_req() }}
25
-
26
- - name: Build
27
- run: tox -e build -v
28
-
29
- - name: Upload packages for publishing job
30
- uses: actions/upload-artifact@v4
31
- with:
32
- name: {{"packages-${{ matrix.os }}"}}
33
- path: |
34
- dist/*.whl
35
- dist/*.tar.gz
36
-
37
- publish:
38
- needs: [build]
39
- runs-on: 'ubuntu-latest'
40
- steps:
41
-
42
- {{ ci.checkout() }}
43
-
44
- {{ ci.pip_install_req() }}
45
-
46
- - name: Download package artifacts
47
- uses: actions/download-artifact@v4
48
- with:
49
- pattern: packages-*
50
- merge-multiple: true
51
- path: dist
52
-
53
- - name: Check generated packages
54
- run: twine check dist/*.*
55
-
56
- - name: Upload packages
57
- env:
58
- TWINE_PASSWORD: {{'"${{ secrets.'+pypi_token+' }}"'}}
59
- TWINE_NON_INTERACTIVE: 1
60
- run: |
61
- twine upload --disable-progress-bar --skip-existing -u __token__ -r {{ pypi_repo }} dist/*.*
@@ -1,69 +0,0 @@
1
- name: CI-CD
2
-
3
- # Controls when the action will run.
4
- on:
5
- # Triggers the workflow on push or pull request events but only for the main branch
6
- push:
7
- branches: [main]
8
- pull_request:
9
- branches: [main]
10
-
11
- # Allows you to run this workflow manually from the Actions tab
12
- workflow_dispatch:
13
-
14
- jobs:
15
- # check if everything works first
16
- tests:
17
- uses: ./.github/workflows/tests.yml
18
-
19
- # make a new version next, release or prerelease
20
- release:
21
- needs: [tests]
22
- uses: ./.github/workflows/release.yml
23
-
24
- build:
25
- needs: [release, tests] # build only if all tests are successful
26
- uses: ./.github/workflows/build.yml
27
- secrets: inherit
28
-
29
- docs:
30
- needs: [release] # get (release) version number first
31
- uses: ./.github/workflows/docs.yml
32
-
33
- coverage:
34
- needs: [tests, docs] # coverage report is added to the docs webpage
35
- uses: ./.github/workflows/coverage.yml
36
-
37
- {#- Some Jinja macros for reusing recurring workflow job steps -#}
38
-
39
- {%- macro checkout(depth=1) -%}
40
- - name: Checking out the repo
41
- uses: actions/checkout@v4
42
- {%- if depth != 1 +%}
43
- with:
44
- fetch-depth: {{ depth }}
45
- {%- endif -%}
46
- {%- endmacro -%}
47
-
48
- {%- macro setup_python(arch, py=py_ver, req=['ci/requirements.txt']) -%}
49
- # see *py_ver* in ci/update.py
50
- - name: Setting up Python {{ py }}
51
- uses: actions/setup-python@v5
52
- with:
53
- python-version: '{{ py }}'
54
- {% if arch %}
55
- architecture: '{{ arch }}'
56
- {% endif %}
57
- cache: pip
58
- cache-dependency-path: |
59
- {%- for fn in req +%}
60
- {{ fn }}
61
- {%- endfor -%}
62
- {%- endmacro -%}
63
-
64
- {% macro pip_install_req() -%}
65
- - name: Install dependencies
66
- run: |
67
- python -m pip install --upgrade pip
68
- python -m pip install --progress-bar=off -r ci/requirements.txt
69
- {%- endmacro +%}
@@ -1,132 +0,0 @@
1
- name: Coverage
2
-
3
- # Controls when the action will run.
4
- on:
5
- workflow_call:
6
-
7
- {% import '.github/workflows/ci-cd.yml' as ci with context %}{# Use some Jinja macros -#}
8
-
9
- env:
10
- DOCS_URL: {{ docs_url }}
11
- COV_REPORT_BASE_DIR: {{ cov_report_path }}
12
-
13
- jobs:
14
- combine:
15
- name: Combine coverage data
16
- runs-on: ubuntu-latest
17
- outputs:
18
- total: {{ '${{ steps.total.outputs.total }}' }}
19
- steps:
20
-
21
- {{ ci.checkout() }}
22
-
23
- {{ ci.setup_python() }}
24
-
25
- {{ ci.pip_install_req() }}
26
-
27
- - name: Download coverage data
28
- uses: actions/download-artifact@v4
29
- with:
30
- name: coverage
31
-
32
- - name: Combine and report
33
- id: combine
34
- run: |
35
- set -x
36
- pwd && ls -la
37
- coverage combine coverage.*
38
- python3 -c 'import coverage,pprint; cov=coverage.Coverage(); cov.load();pprint.pprint(list(cov.get_data()._file_map.keys()))'
39
- coverage html --debug=pathmap
40
-
41
- - name: Upload HTML report
42
- uses: actions/upload-artifact@v4
43
- with:
44
- name: html_report
45
- path: htmlcov
46
-
47
- - name: Get total
48
- id: total
49
- run: |
50
- echo "total=$(coverage report --format=total)" >> $GITHUB_OUTPUT
51
-
52
- publish:
53
- name: Publish coverage report
54
- needs: combine
55
- runs-on: ubuntu-latest
56
-
57
- steps:
58
- - name: Compute info for later steps
59
- id: info
60
- run: |
61
- set -xe
62
- export SHA10=$(echo {{ '${{ github.sha }}' }} | cut -c 1-10)
63
- export SLUG=$(date +'%Y%m%d')_$SHA10
64
- export REPORT_DIR=$COV_REPORT_BASE_DIR/$SLUG
65
- export REF={{'"${{ github.ref }}"'}}
66
- echo "total={{'${{ needs.combine.outputs.total }}'}}" >> $GITHUB_ENV
67
- echo "sha10=$SHA10" >> $GITHUB_ENV
68
- echo "slug=$SLUG" >> $GITHUB_ENV
69
- echo "report_dir=$REPORT_DIR" >> $GITHUB_ENV
70
- echo "branch=${REF#refs/heads/}" >> $GITHUB_ENV
71
-
72
- - name: Summarize
73
- run: |
74
- echo '### Total coverage: {{'${{ env.total }}'}}%' >> $GITHUB_STEP_SUMMARY
75
-
76
- - name: Checkout documentation pages branch
77
- if: {{"${{ github.ref == 'refs/heads/main' }}"}}
78
- uses: actions/checkout@v4
79
- with:
80
- ref: gh-pages
81
- path: pages
82
-
83
- - name: Purge old documentation files
84
- run: cd pages && git rm -rf . || true
85
-
86
- - name: Download previously generated documentation
87
- if: {{"${{ github.ref == 'refs/heads/main' }}"}}
88
- uses: actions/download-artifact@v4
89
- with:
90
- name: docs
91
- path: pages
92
-
93
- - name: Download coverage HTML report
94
- if: {{"${{ github.ref == 'refs/heads/main' }}"}}
95
- uses: actions/download-artifact@v4
96
- with:
97
- name: html_report
98
- path: {{"pages/${{ env.report_dir }}"}}
99
-
100
- - name: Push to report repo
101
- if: {{"${{ github.ref == 'refs/heads/main' }}"}}
102
- env:
103
- COMMIT_MESSAGE: {{'${{ github.event.head_commit.message }}'}}
104
- REDIR_HTML: {{'"pages/${{ env.COV_REPORT_BASE_DIR }}/index.html"'}}
105
- BADGE_JSON: {{'"pages/${{ env.COV_REPORT_BASE_DIR }}/cov.json"'}}
106
- REPORT_URL: {{'"${{ env.DOCS_URL }}/${{ env.report_dir }}"'}}
107
- run: |
108
- set -xe
109
- # Make the redirect to the latest report.
110
- echo "<html><head>" > "$REDIR_HTML"
111
- echo "<meta http-equiv='refresh' content={{"'0;url=$REPORT_URL'"}} />" >> "$REDIR_HTML"
112
- echo "<body>Coverage report redirect..." >> "$REDIR_HTML"
113
- # Make the commit message.
114
- echo {{'"${{ env.total }}% - $COMMIT_MESSAGE"'}} > commit.txt
115
- echo "" >> commit.txt
116
- echo "$REPORT_URL" >> commit.txt
117
- echo {{'"${{ env.sha10 }}: ${{ env.branch }}"'}} >> commit.txt
118
- # Make badge json
119
- COL_MIN=10; COL_MAX=95;
120
- HUE=$(python3 -c "print(int(({{'${{ env.total }}'}} - $COL_MIN)/($COL_MAX - $COL_MIN) * 120))")
121
- echo "{\"schemaVersion\":1,\"label\":\"Coverage\",\"message\":\"{{'${{ env.total }}'}}%\",\"color\":\"hsl($HUE, 100%, 40%)\"}" > "$BADGE_JSON"
122
- # Commit.
123
- cd ./pages
124
- rm -f {{'${{ env.report_dir }}/.gitignore'}}
125
- # ls -la {{'${{ env.report_dir }}'}} # for debugging
126
- # {{"${{ env.report_dir }}"}}/* "${REDIR_HTML#*/}" "${BADGE_JSON#*/}"
127
- git add -A
128
- git config user.name "${GITHUB_ACTOR}"
129
- git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
130
- git commit --file=../commit.txt
131
- git push
132
- echo {{'"[$REPORT_URL]($REPORT_URL)"'}} >> $GITHUB_STEP_SUMMARY
@@ -1,37 +0,0 @@
1
- name: Docs
2
-
3
- # Controls when the action will run.
4
- on:
5
- workflow_call:
6
-
7
- {% import '.github/workflows/ci-cd.yml' as ci with context %}{# Use some Jinja macros -#}
8
-
9
- jobs:
10
- docs:
11
- # defining this job separately allows to refer to it later as job.needs dependency
12
- runs-on: ubuntu-latest
13
- steps:
14
-
15
- {{ ci.checkout(depth=0) }}
16
-
17
- {{ ci.setup_python() }}
18
-
19
- {{ ci.pip_install_req() }}
20
-
21
- - name: Check
22
- run: tox -e check -v
23
-
24
- - name: Generate documentation
25
- run: tox -e docs -v
26
-
27
- - name: Upload docs for finalization later
28
- uses: actions/upload-artifact@v4
29
- with:
30
- name: docs
31
- path: dist/docs
32
-
33
- # - name: Upload generated documentation
34
- # uses: peaceiris/actions-gh-pages@v3
35
- # with:
36
- # github_token: {{'${{ secrets.GITHUB_TOKEN }}'}}
37
- # publish_dir: ./dist/docs
@@ -1,39 +0,0 @@
1
- name: Release
2
-
3
- # Controls when the action will run.
4
- on:
5
- workflow_call:
6
-
7
- {% import '.github/workflows/ci-cd.yml' as ci with context %}{# Use some Jinja macros -#}
8
-
9
- jobs:
10
- # make a new version first, release or prerelease
11
- release:
12
- # Only run this job if new work is pushed to "main"
13
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
14
- runs-on: ubuntu-latest
15
- steps:
16
-
17
- {{ ci.checkout(depth=0) }}
18
-
19
- - name: Setup git user
20
- run: |
21
- git config user.name "${GITHUB_ACTOR}"
22
- git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
23
-
24
- {{ ci.setup_python() }}
25
-
26
- {{ ci.pip_install_req() }}
27
-
28
- - name: Determine a version number
29
- env:
30
- GH_TOKEN: {{'${{ secrets.GITHUB_TOKEN }}'}}
31
- shell: sh
32
- run: |
33
- set -x
34
- NEWVER=$(semantic-release version --print)
35
- sed -i -e "s/v\([0-9]\+\.\)\{3\}/v$NEWVER./" README.rst
36
- sed -i -e "s/\([0-9]\+\.\)\{2\}[0-9]\+/$NEWVER/" .cookiecutterrc
37
- git add README.rst .cookiecutterrc
38
- # creates a release only if there are relevant changes/commits starting with 'fix/feat()'
39
- semantic-release version
@@ -1,58 +0,0 @@
1
- name: Tests
2
-
3
- # Controls when the action will run.
4
- on:
5
- # Allows you to run this workflow manually from the Actions tab
6
- workflow_dispatch:
7
-
8
- workflow_call:
9
-
10
- {% import '.github/workflows/ci-cd.yml' as ci %}{# Use some Jinja macros -#}
11
-
12
- jobs:
13
- # defining this job separately allows to refer to it later as job.needs dependency
14
- tests:
15
- timeout-minutes: 30
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- python_arch: ['x64']
20
- python:
21
- {% for env in tox_environments %}
22
- {% set prefix = env.split('-')[0] %}
23
- - [{{prefix[2]}}, {{prefix[3:]}}]
24
- {% endfor %}
25
- # os: ['ubuntu', 'windows', 'macos']
26
- os: ['ubuntu']
27
- env:
28
- PYTHON: {{"${{ join(matrix.python, '.') }}"}} # e.g. '3.11'
29
- TOX_ENV: {{"${{ format('{0}{1}', 'py', join(matrix.python, '')) }}"}} # e.g. 'py311'
30
- runs-on: {{"${{ format('{0}-latest', matrix.os) }}"}}
31
- name: {{'"Test py-${{ join(matrix.python, \'.\') }} (${{ matrix.os }})"'}}
32
- steps:
33
-
34
- {{ ci.checkout(depth=0) }}
35
-
36
- {{ ci.setup_python(arch='${{ matrix.python_arch }}', py='${{ env.PYTHON }}',
37
- req=['ci/requirements.txt', 'tests/requirements.txt']) }}
38
-
39
- {{ ci.pip_install_req() }}
40
-
41
- - name: Show installed package details
42
- run: |
43
- virtualenv --version
44
- pip --version
45
- tox --version
46
- pip list --format=freeze
47
-
48
- - name: Run tests
49
- run: tox -e {{'${{ env.TOX_ENV }}'}} -v
50
-
51
- - name: Rename coverage data uniquely
52
- run: {{ 'mv .coverage coverage.${{ env.TOX_ENV }}.${{ matrix.os }}' }}
53
-
54
- - name: Upload coverage data for next step
55
- uses: actions/upload-artifact@v4
56
- with:
57
- name: coverage
58
- path: coverage.*
@@ -1,125 +0,0 @@
1
- #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
- # Updates any files with templates in <project root>/ci/templates directory by
4
- # running 'python3 ci/update.py --no-env'
5
- # Typically, github workflow files are generated with the help of tox and its config.
6
- import os
7
- import pathlib
8
- import subprocess
9
- import sys
10
-
11
- import jinja2
12
- import toml
13
- import yaml
14
-
15
- base_path: pathlib.Path = pathlib.Path(__file__).resolve().parent.parent
16
- templates_path = base_path / "ci" / "templates"
17
-
18
-
19
- def check_call(args):
20
- print("+", *args)
21
- subprocess.check_call(args)
22
-
23
-
24
- def exec_in_env():
25
- env_path = base_path / ".tox" / "bootstrap"
26
- if sys.platform == "win32":
27
- bin_path = env_path / "Scripts"
28
- else:
29
- bin_path = env_path / "bin"
30
- if not env_path.exists():
31
- import subprocess
32
-
33
- print("Making bootstrap env in: {0} ...".format(env_path))
34
- try:
35
- check_call([sys.executable, "-m", "venv", env_path])
36
- except subprocess.CalledProcessError:
37
- try:
38
- check_call([sys.executable, "-m", "virtualenv", env_path])
39
- except subprocess.CalledProcessError:
40
- check_call(["virtualenv", env_path])
41
- print("Installing `jinja2` into bootstrap environment...")
42
- check_call([bin_path / "pip", "install", "jinja2", "tox"])
43
- python_executable = bin_path / "python"
44
- if not python_executable.exists():
45
- python_executable = python_executable.with_suffix(".exe")
46
-
47
- print("Re-executing with: {0}".format(python_executable))
48
- print("+ exec", python_executable, __file__, "--no-env")
49
- os.execv(python_executable, [python_executable, __file__, "--no-env"])
50
-
51
-
52
- def loadYaml(filepath: pathlib.Path):
53
- if not filepath.is_file():
54
- return {}
55
- with open(filepath, "r") as fh:
56
- try:
57
- return yaml.safe_load(fh)
58
- except yaml.YAMLError as exc:
59
- print(exc)
60
- return {}
61
-
62
-
63
- def main():
64
- print("Project path: {0}".format(base_path))
65
- # use pyproject.toml as source for paths and urls
66
- project_meta = toml.load(base_path / "pyproject.toml")
67
- # use cookiecutter cfg to file template params not rendered yet
68
- cc = loadYaml(base_path / ".cookiecutterrc")
69
- pypi_host = cc.get("default_context", {}).get("pypi_host", "").split(".")[:-1]
70
-
71
- jinja = jinja2.Environment(
72
- loader=jinja2.FileSystemLoader(str(templates_path)),
73
- trim_blocks=True,
74
- lstrip_blocks=True,
75
- keep_trailing_newline=True,
76
- )
77
-
78
- tox_environments = [
79
- line.strip()
80
- # 'tox' need not be installed globally, but must be importable
81
- # by the Python that is running this script.
82
- for line in subprocess.check_output(
83
- [sys.executable, "-m", "tox", "--listenvs"], universal_newlines=True
84
- ).splitlines()
85
- ]
86
- # add a version number to the generic Python3 name (just 'py') for templates to build ok
87
- tox_environments = [
88
- (line if len(line) > 2 else line + "".join(sys.version.split(".")[:2]))
89
- for line in tox_environments
90
- if line.startswith("py")
91
- ]
92
-
93
- for template in templates_path.rglob("*"):
94
- if template.is_file() and template.name != ".DS_Store":
95
- template_path = str(template.relative_to(templates_path))
96
- destination = base_path / template_path
97
- destination.parent.mkdir(parents=True, exist_ok=True)
98
- destination.write_text(
99
- jinja.get_template(template_path).render(
100
- tox_environments=tox_environments,
101
- docs_url=project_meta["project"]["urls"]["documentation"],
102
- cov_report_path=project_meta["tool"]["coverage"]["report"]["path"],
103
- # Python version to use for general tasks: docs (when tox did not set one)
104
- py_ver=".".join(sys.version.split(".")[:2]),
105
- pypi_token=(
106
- "_".join(pypi_host + ["token"]).upper()
107
- if len(pypi_host)
108
- else "TEST_PYPI_TOKEN"
109
- ),
110
- pypi_repo="".join(pypi_host) if len(pypi_host) else "testpypi",
111
- )
112
- )
113
- print("Wrote {}".format(template_path))
114
- print("DONE.")
115
-
116
-
117
- if __name__ == "__main__":
118
- args = sys.argv[1:]
119
- if args == ["--no-env"]:
120
- main()
121
- elif not args:
122
- exec_in_env()
123
- else:
124
- print("Unexpected arguments {0}".format(args), file=sys.stderr)
125
- sys.exit(1)