PQEnalyzer 0.6.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. pqenalyzer-0.6.2/.githooks/commit-msg +169 -0
  2. pqenalyzer-0.6.2/.github/workflows/ci.yml +39 -0
  3. pqenalyzer-0.6.2/.github/workflows/release.yml +156 -0
  4. pqenalyzer-0.6.2/.gitignore +169 -0
  5. pqenalyzer-0.6.2/.pylintrc +663 -0
  6. pqenalyzer-0.6.2/LICENSE +21 -0
  7. pqenalyzer-0.6.2/PKG-INFO +53 -0
  8. pqenalyzer-0.6.2/PQEnalyzer/__init__.py +16 -0
  9. pqenalyzer-0.6.2/PQEnalyzer/__main__.py +85 -0
  10. pqenalyzer-0.6.2/PQEnalyzer/__version__.py +16 -0
  11. pqenalyzer-0.6.2/PQEnalyzer/apps/__init__.py +5 -0
  12. pqenalyzer-0.6.2/PQEnalyzer/apps/app.py +409 -0
  13. pqenalyzer-0.6.2/PQEnalyzer/apps/termapp.py +100 -0
  14. pqenalyzer-0.6.2/PQEnalyzer/icons/icon.png +0 -0
  15. pqenalyzer-0.6.2/PQEnalyzer/plots/__init__.py +7 -0
  16. pqenalyzer-0.6.2/PQEnalyzer/plots/plot.py +256 -0
  17. pqenalyzer-0.6.2/PQEnalyzer/plots/plot_histogram.py +165 -0
  18. pqenalyzer-0.6.2/PQEnalyzer/plots/plot_time.py +181 -0
  19. pqenalyzer-0.6.2/PQEnalyzer/plots/termplot.py +65 -0
  20. pqenalyzer-0.6.2/PQEnalyzer/readers/__init__.py +4 -0
  21. pqenalyzer-0.6.2/PQEnalyzer/readers/reader.py +119 -0
  22. pqenalyzer-0.6.2/PQEnalyzer/statistics/__init__.py +4 -0
  23. pqenalyzer-0.6.2/PQEnalyzer/statistics/statistic.py +238 -0
  24. pqenalyzer-0.6.2/PQEnalyzer.egg-info/PKG-INFO +53 -0
  25. pqenalyzer-0.6.2/PQEnalyzer.egg-info/SOURCES.txt +53 -0
  26. pqenalyzer-0.6.2/PQEnalyzer.egg-info/dependency_links.txt +1 -0
  27. pqenalyzer-0.6.2/PQEnalyzer.egg-info/entry_points.txt +2 -0
  28. pqenalyzer-0.6.2/PQEnalyzer.egg-info/requires.txt +17 -0
  29. pqenalyzer-0.6.2/PQEnalyzer.egg-info/top_level.txt +1 -0
  30. pqenalyzer-0.6.2/README.md +25 -0
  31. pqenalyzer-0.6.2/codecov.yml +6 -0
  32. pqenalyzer-0.6.2/examples/md-01.en +5000 -0
  33. pqenalyzer-0.6.2/examples/md-01.info +10 -0
  34. pqenalyzer-0.6.2/examples/md-02.en +5000 -0
  35. pqenalyzer-0.6.2/examples/md-02.info +11 -0
  36. pqenalyzer-0.6.2/examples/md-03.en +25000 -0
  37. pqenalyzer-0.6.2/examples/md-03.info +11 -0
  38. pqenalyzer-0.6.2/pyproject.toml +48 -0
  39. pqenalyzer-0.6.2/setup.cfg +4 -0
  40. pqenalyzer-0.6.2/tests/__init__.py +0 -0
  41. pqenalyzer-0.6.2/tests/benchmark/__init__.py +0 -0
  42. pqenalyzer-0.6.2/tests/benchmark/test_reader_benchmark.py +20 -0
  43. pqenalyzer-0.6.2/tests/benchmark/test_statistic_benchmark.py +22 -0
  44. pqenalyzer-0.6.2/tests/data/empty.en +0 -0
  45. pqenalyzer-0.6.2/tests/data/empty.info +0 -0
  46. pqenalyzer-0.6.2/tests/data/md-01.en +5 -0
  47. pqenalyzer-0.6.2/tests/data/md-01.info +10 -0
  48. pqenalyzer-0.6.2/tests/data/md-02.en +5 -0
  49. pqenalyzer-0.6.2/tests/data/md-02.info +11 -0
  50. pqenalyzer-0.6.2/tests/data/md-03.en +10 -0
  51. pqenalyzer-0.6.2/tests/data/md-03.info +11 -0
  52. pqenalyzer-0.6.2/tests/reader/__init__.py +1 -0
  53. pqenalyzer-0.6.2/tests/reader/test_reader.py +78 -0
  54. pqenalyzer-0.6.2/tests/statistics/__init__.py +1 -0
  55. pqenalyzer-0.6.2/tests/statistics/test_statistic.py +87 -0
@@ -0,0 +1,169 @@
1
+ #!/bin/bash
2
+
3
+ message=$(cat .git/COMMIT_EDITMSG)
4
+ lowercase_message=${message,,}
5
+
6
+ # Check for patterns and handle errors
7
+ matched=false
8
+
9
+ # Features
10
+ if [[ "$lowercase_message" =~ ^feat(\(.+\))?: ]]; then
11
+ matched=true
12
+ group="Feature"
13
+ fi
14
+
15
+ # Bug Fixes
16
+ if [[ "$lowercase_message" =~ ^fix(\(.+\))?: ]]; then
17
+ matched=true
18
+ group="Fix"
19
+ fi
20
+
21
+ if [[ "$lowercase_message" =~ ^docs(\(.+\))?: ]]; then
22
+ matched=true
23
+ group="Docs"
24
+ elif [[ "$lowercase_message" =~ ^doc(\(.+\))?: ]]; then
25
+ matched=true
26
+ group="Docs"
27
+ fi
28
+
29
+ if [[ "$lowercase_message" =~ ^style(\(.+\))?: ]]; then
30
+ matched=true
31
+ group="Style"
32
+ fi
33
+
34
+ if [[ "$lowercase_message" =~ ^refactor(\(.+\))?: ]]; then
35
+ matched=true
36
+ group="Refactor"
37
+ elif [[ "$lowercase_message" =~ ^ref(\(.+\))?: ]]; then
38
+ matched=true
39
+ group="Refactor"
40
+ fi
41
+
42
+ if [[ "$lowercase_message" =~ ^perf(\(.+\))?: ]]; then
43
+ matched=true
44
+ group="Performance"
45
+ fi
46
+
47
+ if [[ "$lowercase_message" =~ ^test(\(.+\))?: ]]; then
48
+ matched=true
49
+ group="Test"
50
+ elif [[ "$lowercase_message" =~ ^tests(\(.+\))?: ]]; then
51
+ matched=true
52
+ group="Test"
53
+ fi
54
+
55
+ #chore
56
+ if [[ "$lowercase_message" =~ ^chore(\(.+\))?: ]]; then
57
+ matched=true
58
+ group="Chore"
59
+ fi
60
+
61
+ #merge
62
+ if [[ "$lowercase_message" =~ ^merge(\(.+\))?: ]]; then
63
+ matched=true
64
+ group="Merge"
65
+ fi
66
+
67
+ # Reverts
68
+ if [[ "$lowercase_message" =~ ^revert(\(.+\))?: ]]; then
69
+ matched=true
70
+ group="Revert"
71
+ fi
72
+
73
+ if [[ "$lowercase_message" =~ ^build(\(.+\))?: ]]; then
74
+ matched=true
75
+ group="Breaking"
76
+ fi
77
+
78
+ # Examples
79
+ if [[ "$lowercase_message" =~ ^example(\(.+\))?: ]]; then
80
+ matched=true
81
+ group="Example"
82
+ elif [[ "$lowercase_message" =~ ^examples(\(.+\))?: ]]; then
83
+ matched=true
84
+ group="Example"
85
+ fi
86
+
87
+ # Dependency Updates (informational)
88
+ if [[ "$lowercase_message" =~ ^deps(\(.+\))?: ]]; then
89
+ matched=true
90
+ group="Dependency"
91
+ fi
92
+
93
+ # ci
94
+ if [[ "$lowercase_message" =~ ^ci(\(.+\))?: ]]; then
95
+ matched=true
96
+ group="CI"
97
+ fi
98
+
99
+ #pylint
100
+ if [[ "$lowercase_message" =~ ^pylint(\(.+\))?: ]]; then
101
+ matched=true
102
+ group="Pylint"
103
+ fi
104
+
105
+ if [[ "$lowercase_message" =~ ^admin(\(.+\))?: ]]; then
106
+ matched=true
107
+ group="Administrative"
108
+ fi
109
+
110
+ #random stuff that doesn't fit into any of the above categories
111
+ #starting with a $
112
+ if [[ "$lowercase_message" =~ ^\$ ]]; then
113
+ matched=true
114
+ group="Random"
115
+ fi
116
+
117
+ # ... (similar checks for other patterns in the list)
118
+
119
+ # No match found
120
+ if ! $matched; then
121
+ echo "Error: Commit message header '$message' does not match any defined pattern!\n"
122
+
123
+ #list me all possible patterns per group in a nice formatted output
124
+ echo "Possible patterns are:"
125
+ echo " - Group: Pattern(s)"
126
+ echo " - --------------------------------------------"
127
+ echo " - Feature: feat:"
128
+ echo " - Fix: fix:"
129
+ echo " - Docs: docs:, doc:"
130
+ echo " - Style: style:"
131
+ echo " - Refactor: refactor:, ref:"
132
+ echo " - Performance: perf:"
133
+ echo " - Test: test:, tests:"
134
+ echo " - Chore: chore:"
135
+ echo " - Merge: merge:"
136
+ echo " - Revert: revert:"
137
+ echo " - Build: build:"
138
+ echo " - Example: example:, examples:"
139
+ echo " - Dependency: deps:"
140
+ echo " - CI: ci:"
141
+ echo " - Pylint: pylint:"
142
+ echo " - Administrative: admin:"
143
+ echo " - Random: $"
144
+ # ... (similar output for other patterns in the list)
145
+ echo " - --------------------------------------------\n"
146
+
147
+ echo "Please use one of the patterns above in the commit message header."
148
+ echo "You can also add a scope in parentheses after the pattern (e.g. 'feat(scope): ...')."
149
+ exit 1
150
+ fi
151
+
152
+ # Matched a pattern, check for skip flag (optional)
153
+ if [[ ${skip+unset} ]]; then # Check if skip variable is set
154
+ if [[ "$lowercase_message" =~ $skip ]]; then
155
+ echo "Skipping commit '$message' (marked for skipping)"
156
+ exit 0 # Allow skipping with exit code 0 for a clean commit process
157
+ fi
158
+ fi
159
+
160
+ # Check for duplicate Signed-off-by lines (optional)
161
+ test "" = "$(grep '^Signed-off-by: ' "$1" | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
162
+ echo >&2 "Error: Duplicate Signed-off-by lines found in commit message!"
163
+ exit 1
164
+ }
165
+
166
+ # Commit passed checks (optional)
167
+ echo "Commit message '$message' ($group) looks good!"
168
+
169
+ # Script exits successfully (no need for explicit exit code)
@@ -0,0 +1,39 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - develop
8
+ pull_request:
9
+ branches:
10
+ - '*'
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - uses: actions/checkout@master
18
+ - name: Setup Python
19
+ uses: actions/setup-python@master
20
+ with:
21
+ python-version: '3.12'
22
+
23
+ - name: build PQEnalyzer
24
+ run: |
25
+ pip install .
26
+
27
+ - name: Generate coverage report
28
+ run: |
29
+ pip install .[test]
30
+ python -m pytest -m "not benchmark" --cov=PQEnalyzer --cov-report=xml
31
+
32
+ - name: Upload coverage to Codecov
33
+ uses: codecov/codecov-action@v3
34
+ with:
35
+ token: ${{ secrets.CODECOV_TOKEN }}
36
+ env_vars: OS,PYTHON
37
+ fail_ci_if_error: true
38
+ flags: unittests
39
+ verbose: true
@@ -0,0 +1,156 @@
1
+ name: Publish Python distribution to PyPI and TestPyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '**'
7
+
8
+ permissions: write-all
9
+
10
+ jobs:
11
+ build:
12
+ name: Build distribution
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v4
19
+ with:
20
+ python-version: "3.12"
21
+ - name: Install pypa/build
22
+ run: |
23
+ python3 -m pip install build --user
24
+ python3 -m pip install twine --user
25
+ python3 -m pip install wheel --user
26
+
27
+ - name: Build a binary wheel and a source tarball
28
+ run: python3 -m build
29
+ - name: Store the distribution packages
30
+ uses: actions/upload-artifact@v3
31
+ with:
32
+ name: python-package-distributions
33
+ path: dist/
34
+
35
+ publish-to-pypi:
36
+ name: >-
37
+ Publish Python distribution to PyPI
38
+ needs:
39
+ - build
40
+ runs-on: ubuntu-latest
41
+ environment:
42
+ name: pypi
43
+ url: https://pypi.org/p/PQAnalysis
44
+ permissions:
45
+ id-token: write # IMPORTANT: mandatory for trusted publishing
46
+
47
+ steps:
48
+ - name: Download all the dists
49
+ uses: actions/download-artifact@v3
50
+ with:
51
+ name: python-package-distributions
52
+ path: dist/
53
+ - name: Publish distribution to PyPI
54
+ uses: pypa/gh-action-pypi-publish@release/v1
55
+
56
+ github-release:
57
+ name: >-
58
+ Create or update GitHub Release
59
+ runs-on: ubuntu-latest
60
+
61
+ permissions:
62
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
63
+ id-token: write # IMPORTANT: mandatory for sigstore
64
+
65
+ steps:
66
+ - uses: actions/checkout@v4
67
+ with:
68
+ fetch-depth: 0
69
+
70
+ - name: setup python
71
+ uses: actions/setup-python@v2
72
+ with:
73
+ python-version: '3.12'
74
+
75
+ - name: build git-changelog
76
+ run: |
77
+ python3 -m pip install git-changelog
78
+
79
+ - name: Get previous tag
80
+ id: previousTag
81
+ run: |
82
+ name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
83
+ echo "previousTag: $name"
84
+ echo "previousTag=$name" >> $GITHUB_ENV
85
+ echo "::set-output name=previousTag::$name"
86
+
87
+ - name: generate new changelog
88
+ run: |
89
+ name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
90
+ echo "git-changelog=$(git-changelog --sections ci,doc,feat,fix,perf,test -F "$name.." -c angular)" >> $GITHUB_ENV
91
+
92
+ - name: Create GitHub Release
93
+ env:
94
+ GITHUB_TOKEN: ${{ github.token }}
95
+ run: >-
96
+ gh release create
97
+ '${{ github.ref_name }}'
98
+ --repo '${{ github.repository }}'
99
+ --notes "${changelog}"
100
+
101
+ - name: Build CHANGELOG.md
102
+ run: |
103
+ git-changelog --sections ci,doc,feat,fix,perf,test -o CHANGELOG.md -c angular --in-place
104
+
105
+ - name: Add CHANGELOG.md to commit
106
+ run: |
107
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
108
+ git config --global user.name "github-actions[bot]"
109
+
110
+ git add CHANGELOG.md
111
+ git commit -m "Docs: Update CHANGELOG.md on release event"
112
+
113
+ - name: Push changes
114
+ if: github.event_name == 'push'
115
+ uses: ad-m/github-push-action@master
116
+ with:
117
+ github_token: ${{ secrets.GITHUB_TOKEN }}
118
+ branch: 'main'
119
+
120
+ pypi-release-update:
121
+ name: >-
122
+ Sign the Python distribution with Sigstore
123
+ and upload them to GitHub Release
124
+ needs:
125
+ - publish-to-pypi
126
+ - github-release
127
+ runs-on: ubuntu-latest
128
+
129
+ permissions:
130
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
131
+ id-token: write # IMPORTANT: mandatory for sigstore
132
+
133
+ steps:
134
+ - name: Download all the dists
135
+ uses: actions/download-artifact@v3
136
+ with:
137
+ name: python-package-distributions
138
+ path: dist/
139
+
140
+ - name: Sign the dists with Sigstore
141
+ uses: sigstore/gh-action-sigstore-python@v2.1.1
142
+ with:
143
+ inputs: >-
144
+ ./dist/*.tar.gz
145
+ ./dist/*.whl
146
+
147
+ - name: Upload artifact signatures to GitHub Release
148
+ env:
149
+ GITHUB_TOKEN: ${{ github.token }}
150
+ # Upload to GitHub Release using the `gh` CLI.
151
+ # `dist/` contains the built packages, and the
152
+ # sigstore-produced signatures and certificates.
153
+ run: >-
154
+ gh release upload
155
+ '${{ github.ref_name }}' dist/**
156
+ --repo '${{ github.repository }}'
@@ -0,0 +1,169 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ .idea/
161
+
162
+ # VSCode
163
+ .vscode/
164
+
165
+ # Executables
166
+ main.py
167
+
168
+ # Version control
169
+ __version__.py