Herkules 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.
Files changed (49) hide show
  1. herkules-1.0.0/.flake8 +4 -0
  2. herkules-1.0.0/.gitattributes +7 -0
  3. herkules-1.0.0/.gitignore +18 -0
  4. herkules-1.0.0/.python-version +1 -0
  5. herkules-1.0.0/CHANGELOG.md +27 -0
  6. herkules-1.0.0/CODE_OF_CONDUCT.md +77 -0
  7. herkules-1.0.0/LICENSE.md +31 -0
  8. herkules-1.0.0/PKG-INFO +94 -0
  9. herkules-1.0.0/README.md +73 -0
  10. herkules-1.0.0/example_herkules.py +54 -0
  11. herkules-1.0.0/include/hercules_beetle_george_shaw.jpg +0 -0
  12. herkules-1.0.0/pyproject.toml +55 -0
  13. herkules-1.0.0/script/README.md +1 -0
  14. herkules-1.0.0/script/bootstrap +14 -0
  15. herkules-1.0.0/script/bootstrap.ps1 +6 -0
  16. herkules-1.0.0/script/lint +11 -0
  17. herkules-1.0.0/script/lint.ps1 +8 -0
  18. herkules-1.0.0/script/setup +24 -0
  19. herkules-1.0.0/script/setup.ps1 +11 -0
  20. herkules-1.0.0/script/test +42 -0
  21. herkules-1.0.0/script/test.ps1 +25 -0
  22. herkules-1.0.0/script/update +13 -0
  23. herkules-1.0.0/script/update.ps1 +5 -0
  24. herkules-1.0.0/src/herkules/Herkules.py +236 -0
  25. herkules-1.0.0/src/herkules/__init__.py +0 -0
  26. herkules-1.0.0/tests/__init__.py +0 -0
  27. herkules-1.0.0/tests/beetle/.hidden +0 -0
  28. herkules-1.0.0/tests/beetle/.hidden.txt +0 -0
  29. herkules-1.0.0/tests/beetle/.hiddendir/.hidden +0 -0
  30. herkules-1.0.0/tests/beetle/.hiddendir/.hidden.txt +0 -0
  31. herkules-1.0.0/tests/beetle/.hiddendir/multi.dot.longext +0 -0
  32. herkules-1.0.0/tests/beetle/.hiddendir/normal.txt +0 -0
  33. herkules-1.0.0/tests/beetle/.hiddendir.ext/.hidden +0 -0
  34. herkules-1.0.0/tests/beetle/.hiddendir.ext/.hidden.txt +0 -0
  35. herkules-1.0.0/tests/beetle/.hiddendir.ext/multi.dot.longext +0 -0
  36. herkules-1.0.0/tests/beetle/.hiddendir.ext/normal.txt +0 -0
  37. herkules-1.0.0/tests/beetle/dir.ext/.hidden +0 -0
  38. herkules-1.0.0/tests/beetle/dir.ext/.hidden.txt +0 -0
  39. herkules-1.0.0/tests/beetle/dir.ext/multi.dot.longext +0 -0
  40. herkules-1.0.0/tests/beetle/dir.ext/normal.txt +0 -0
  41. herkules-1.0.0/tests/beetle/directory/.hidden +0 -0
  42. herkules-1.0.0/tests/beetle/directory/.hidden.txt +0 -0
  43. herkules-1.0.0/tests/beetle/directory/multi.dot.longext +0 -0
  44. herkules-1.0.0/tests/beetle/directory/normal.txt +0 -0
  45. herkules-1.0.0/tests/beetle/multi.dot.longext +0 -0
  46. herkules-1.0.0/tests/beetle/normal.txt +0 -0
  47. herkules-1.0.0/tests/common.py +50 -0
  48. herkules-1.0.0/tests/test_beetle.py +512 -0
  49. herkules-1.0.0/uv.lock +289 -0
herkules-1.0.0/.flake8 ADDED
@@ -0,0 +1,4 @@
1
+ [flake8]
2
+ extend-ignore = E301,E303
3
+ max-cognitive-complexity = 7
4
+ max-line-length = 80
@@ -0,0 +1,7 @@
1
+ * text=auto eol=lf
2
+
3
+ *.bat text eol=crlf
4
+ *.ps1 text eol=crlf
5
+
6
+ *.jpg -text binary
7
+ *.png -text binary
@@ -0,0 +1,18 @@
1
+ # environments
2
+ .envrc
3
+ .venv
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.py[oc]
8
+ build/
9
+ dist/
10
+ wheels/
11
+ *.egg-info
12
+
13
+ # pytest
14
+ .pytest_cache/
15
+
16
+ # Stempelwerk
17
+ *_Debug.txt
18
+ .last_run
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,27 @@
1
+ # Change Log
2
+
3
+ _All notable changes to this project will be documented in this
4
+ file. This change log follows the conventions of
5
+ [keepachangelog.com]._
6
+
7
+ _I tend to not use
8
+ [semantic versioning](https://semver.org/), but we will see what
9
+ happens._
10
+
11
+ <!--- ---------------------------------------------------------------------- -->
12
+
13
+ ## [Unreleased]
14
+
15
+ ### Changed
16
+
17
+ <!--- ---------------------------------------------------------------------- -->
18
+
19
+ ## [1.0.0] - 2024-08-08
20
+
21
+ - This is the first stable release (although I have been using it professionally for over two years now).
22
+
23
+ <!--- ---------------------------------------------------------------------- -->
24
+
25
+ [keepachangelog.com]: http://keepachangelog.com/
26
+ [unreleased]: https://github.com/mzuther/Herkules/tree/develop
27
+ [1.0.0]: https://github.com/mzuther/Herkules/commits/v1.0.0
@@ -0,0 +1,77 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to make participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies within all project spaces, and it also applies when
49
+ an individual is representing the project or its community in public spaces.
50
+ Examples of representing a project or community include using an official
51
+ project e-mail address, posting via an official social media account, or acting
52
+ as an appointed representative at an online or offline event. Representation of
53
+ a project may be further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at http://www.mzuther.de/en/contact/. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
74
+
75
+ For answers to common questions about this code of conduct, see
76
+ https://www.contributor-covenant.org/faq
77
+
@@ -0,0 +1,31 @@
1
+ # BSD 3-Clause License
2
+
3
+ **Copyright (c) 2022-2025 [Martin Zuther](https://www.mzuther.de/)**
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are
7
+ met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright
10
+ notice, this list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright
13
+ notice, this list of conditions and the following disclaimer in the
14
+ documentation and/or other materials provided with the
15
+ distribution.
16
+
17
+ 3. Neither the name of the copyright holder nor the names of its
18
+ contributors may be used to endorse or promote products derived
19
+ from this software without specific prior written permission.
20
+
21
+ _THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE._
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: Herkules
3
+ Version: 1.0.0
4
+ Summary: Crawl directories with style
5
+ Project-URL: Homepage, https://github.com/mzuther/herkules
6
+ Project-URL: Repository, https://github.com/mzuther/herkules.git
7
+ Project-URL: Changelog, https://github.com/mzuther/herkules/blob/main/CHANGELOG.md
8
+ Author-email: Martin Zuther <code@mzuther.de>
9
+ License-Expression: BSD-3-Clause
10
+ License-File: LICENSE.md
11
+ Keywords: file search,pure,simple
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: BSD License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Topic :: Utilities
19
+ Requires-Python: <4.0,>=3.10
20
+ Description-Content-Type: text/markdown
21
+
22
+ # Herkules
23
+
24
+ _Crawl directories with style_
25
+
26
+ <figure style="display: flex; flex-flow: column; max-width: 25em;">
27
+ <img src="include/hercules_beetle_george_shaw.jpg"
28
+ alt="Illustration of a Hercules beetle" />
29
+ <figurecaption>
30
+ <small>
31
+ <em>
32
+ Illustration by George Shaw (obtained from
33
+ <a href="https://en.wikipedia.org/wiki/File:%22_Hercules_beetle_illustration_from_The_Naturalist%27s_Miscellany_(1789-1813)_by_George_Shaw_(1751-1813)._%22.jpg">
34
+ Wikimedia Commons</a>)
35
+ </em>
36
+ </small>
37
+ </figurecaption>
38
+ </figure>
39
+
40
+ ## Introduction
41
+
42
+ Herkules is named after the beautiful large Hercules beetle (Dynastes hercules).
43
+ It provides a recursive, filtered and sorted list of the contents of a given
44
+ root directory. I find it easier to use than Python's `os.scandir`, but your
45
+ mileage may differ.
46
+
47
+ ## Installation
48
+
49
+ _Herkules is now developed using Python v3.12. Older versions of Python used to
50
+ work and will probably still do, but you are on your own here._
51
+
52
+ Unless you want to test Herkules, simply store it somewhere and import it. For
53
+ testing, you must install it into a virtual environment. The easiest way is to
54
+ run
55
+
56
+ ```bash
57
+ # bash
58
+ ./script/bootstrap
59
+ ```
60
+
61
+ or
62
+
63
+ ```ps1
64
+ # PowerShell
65
+ .\script\bootstrap.ps1
66
+ ```
67
+
68
+ For a very simple "no-options" experience, install from PyPI and execute the
69
+ included script:
70
+
71
+ ```bash
72
+ # bash
73
+ pip install herkules
74
+ herkules "./directory/"
75
+ ```
76
+
77
+ ## Execution
78
+
79
+ See [example_herkules.py](./example_herkules.py) for example code and an
80
+ explanation of parameters.
81
+
82
+ ## Code of conduct
83
+
84
+ Please read the [code of conduct](./CODE_OF_CONDUCT.md) before asking for help,
85
+ filing bug reports or contributing to this project. Thanks!
86
+
87
+ ## License
88
+
89
+ Copyright (c) 2022-2025 [Martin Zuther](https://www.mzuther.de/)
90
+
91
+ This program is free software and licensed under the terms of the [BSD 3-Clause
92
+ License](./LICENSE.md).
93
+
94
+ **Thank you for using free software!**
@@ -0,0 +1,73 @@
1
+ # Herkules
2
+
3
+ _Crawl directories with style_
4
+
5
+ <figure style="display: flex; flex-flow: column; max-width: 25em;">
6
+ <img src="include/hercules_beetle_george_shaw.jpg"
7
+ alt="Illustration of a Hercules beetle" />
8
+ <figurecaption>
9
+ <small>
10
+ <em>
11
+ Illustration by George Shaw (obtained from
12
+ <a href="https://en.wikipedia.org/wiki/File:%22_Hercules_beetle_illustration_from_The_Naturalist%27s_Miscellany_(1789-1813)_by_George_Shaw_(1751-1813)._%22.jpg">
13
+ Wikimedia Commons</a>)
14
+ </em>
15
+ </small>
16
+ </figurecaption>
17
+ </figure>
18
+
19
+ ## Introduction
20
+
21
+ Herkules is named after the beautiful large Hercules beetle (Dynastes hercules).
22
+ It provides a recursive, filtered and sorted list of the contents of a given
23
+ root directory. I find it easier to use than Python's `os.scandir`, but your
24
+ mileage may differ.
25
+
26
+ ## Installation
27
+
28
+ _Herkules is now developed using Python v3.12. Older versions of Python used to
29
+ work and will probably still do, but you are on your own here._
30
+
31
+ Unless you want to test Herkules, simply store it somewhere and import it. For
32
+ testing, you must install it into a virtual environment. The easiest way is to
33
+ run
34
+
35
+ ```bash
36
+ # bash
37
+ ./script/bootstrap
38
+ ```
39
+
40
+ or
41
+
42
+ ```ps1
43
+ # PowerShell
44
+ .\script\bootstrap.ps1
45
+ ```
46
+
47
+ For a very simple "no-options" experience, install from PyPI and execute the
48
+ included script:
49
+
50
+ ```bash
51
+ # bash
52
+ pip install herkules
53
+ herkules "./directory/"
54
+ ```
55
+
56
+ ## Execution
57
+
58
+ See [example_herkules.py](./example_herkules.py) for example code and an
59
+ explanation of parameters.
60
+
61
+ ## Code of conduct
62
+
63
+ Please read the [code of conduct](./CODE_OF_CONDUCT.md) before asking for help,
64
+ filing bug reports or contributing to this project. Thanks!
65
+
66
+ ## License
67
+
68
+ Copyright (c) 2022-2025 [Martin Zuther](https://www.mzuther.de/)
69
+
70
+ This program is free software and licensed under the terms of the [BSD 3-Clause
71
+ License](./LICENSE.md).
72
+
73
+ **Thank you for using free software!**
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env python3
2
+
3
+ # %% Imports
4
+ import datetime
5
+ import pathlib
6
+
7
+ from src.herkules.Herkules import herkules
8
+
9
+
10
+ # %% Initialization
11
+ # directory to be crawled (can also be a string)
12
+ ROOT_DIRECTORY = pathlib.Path('.')
13
+
14
+ # optional: return directories and their contents before regular files
15
+ DIRECTORIES_FIRST = True
16
+
17
+ # optional: whether subdirectories should be included in the output; their
18
+ # contents will always be crawled, however, regardless of this setting
19
+ INCLUDE_DIRECTORIES = False
20
+
21
+ # optional: include files and directories which are symlinks
22
+ FOLLOW_SYMLINKS = False
23
+
24
+ # globs: https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.match
25
+ SELECTOR = {
26
+ # optional: directories that should not be crawled (full name is matched)
27
+ 'excluded_directory_names': [
28
+ '.git',
29
+ ],
30
+ # optional: file names that should be included in the result (glob)
31
+ 'excluded_file_names': [
32
+ '*.*c',
33
+ ],
34
+ # optional: file names that should be excluded from the result (glob,
35
+ # "*" by default)
36
+ 'included_file_names': [
37
+ ],
38
+ }
39
+
40
+ # optional: only include directories and files with were modified at or past
41
+ # the given time; for symlinks, this checks the original file
42
+ MODIFIED_SINCE = datetime.datetime(2024, 8, 1, 8, 30, 0)
43
+
44
+
45
+ # %% Crawl directory & display results
46
+ # "herkules()" returns a list of "pathlib.Path" objects
47
+ contents = herkules(
48
+ ROOT_DIRECTORY, DIRECTORIES_FIRST, INCLUDE_DIRECTORIES,
49
+ FOLLOW_SYMLINKS, SELECTOR, MODIFIED_SINCE)
50
+
51
+ print()
52
+ for entry in contents:
53
+ print(f'* { entry }')
54
+ print()
@@ -0,0 +1,55 @@
1
+ [project]
2
+ name = "Herkules"
3
+ dynamic = ["version"]
4
+ description = "Crawl directories with style"
5
+ keywords = ["file search", "simple", "pure"]
6
+ classifiers = [
7
+ "Development Status :: 5 - Production/Stable",
8
+ "Environment :: Console",
9
+ "Intended Audience :: Developers",
10
+ "License :: OSI Approved :: BSD License",
11
+ "Operating System :: OS Independent",
12
+ "Programming Language :: Python :: 3",
13
+ "Topic :: Utilities",
14
+ ]
15
+ authors = [{ name = "Martin Zuther", email = "code@mzuther.de" }]
16
+ requires-python = ">=3.10,<4.0"
17
+ readme = "README.md"
18
+ license = "BSD-3-Clause"
19
+ license-files = ["LICENSE.md"]
20
+
21
+ [project.scripts]
22
+ herkules = "herkules.Herkules:main_cli"
23
+
24
+ [project.urls]
25
+ Homepage = "https://github.com/mzuther/herkules"
26
+ Repository = "https://github.com/mzuther/herkules.git"
27
+ Changelog = "https://github.com/mzuther/herkules/blob/main/CHANGELOG.md"
28
+
29
+ [dependency-groups]
30
+ dev = [
31
+ "flake8>=6.0.0,<7",
32
+ "flake8-cognitive-complexity>=0.1.0,<0.2",
33
+ "flake8-fixme>=1.1.1,<2",
34
+ "flake8-pytest-style>=1.7.2,<2",
35
+ "pip-licenses>=5.0.0,<6",
36
+ "pytest>=7.3.0,<8",
37
+ "pytest-datafiles>=3.0.0,<4",
38
+ ]
39
+
40
+ [build-system]
41
+ requires = ["hatchling >= 1.27"]
42
+ build-backend = "hatchling.build"
43
+
44
+ [tool.hatch.version]
45
+ path = "src/herkules/Herkules.py"
46
+
47
+ [tool.pytest.ini_options]
48
+ minversion = "6.0"
49
+ markers = [
50
+ "current: marks tests as current (select with '-m current')",
51
+ "slow: marks tests as slow (deselect with '-m \"not slow\"')",
52
+ ]
53
+ testpaths = [
54
+ "tests",
55
+ ]
@@ -0,0 +1 @@
1
+ Scripts for setting up and testing this application (https://github.com/github/scripts-to-rule-them-all).
@@ -0,0 +1,14 @@
1
+ #! /bin/bash
2
+
3
+ echo
4
+
5
+ # create virtual environment and install dependencies
6
+ uv sync --no-managed-python
7
+ EXIT_CODE=$?
8
+
9
+ if [ $EXIT_CODE -ne 0 ]; then
10
+ echo
11
+ exit $EXIT_CODE
12
+ fi
13
+
14
+ echo
@@ -0,0 +1,6 @@
1
+ Write-Output ""
2
+
3
+ # create virtual environment and install dependencies
4
+ uv sync --no-managed-python
5
+
6
+ Write-Output ""
@@ -0,0 +1,11 @@
1
+ #! /bin/bash
2
+
3
+ echo
4
+
5
+ uv run flake8 --config="./.flake8" src/
6
+ EXIT_CODE=$?
7
+
8
+ if [ $EXIT_CODE -ne 0 ]; then
9
+ echo
10
+ exit $EXIT_CODE
11
+ fi
@@ -0,0 +1,8 @@
1
+ Write-Output ""
2
+
3
+ uv run flake8 --config=".flake8" src/
4
+
5
+ If (-Not $?)
6
+ {
7
+ exit
8
+ }
@@ -0,0 +1,24 @@
1
+ #! /bin/bash
2
+
3
+ echo
4
+ uv tree --no-dev
5
+ EXIT_CODE=$?
6
+
7
+ if [ $EXIT_CODE -ne 0 ]; then
8
+ echo
9
+ exit $EXIT_CODE
10
+ fi
11
+
12
+ echo
13
+ echo "------------------------------------------------------------------------"
14
+ echo
15
+
16
+ uv tree --only-dev
17
+ EXIT_CODE=$?
18
+
19
+ if [ $EXIT_CODE -ne 0 ]; then
20
+ echo
21
+ exit $EXIT_CODE
22
+ fi
23
+
24
+ echo
@@ -0,0 +1,11 @@
1
+ Write-Output ""
2
+
3
+ uv tree --no-dev
4
+
5
+ Write-Output ""
6
+ Write-Output "------------------------------------------------------------------------"
7
+ Write-Output ""
8
+
9
+ uv tree --only-dev
10
+
11
+ Write-Output ""
@@ -0,0 +1,42 @@
1
+ #! /bin/bash
2
+
3
+ echo
4
+
5
+ # run quick tests first
6
+ echo "[QUICK TESTS]"
7
+ echo
8
+
9
+ uv run pytest --ignore="./.git" -m "not slow" "$@"
10
+ EXIT_CODE=$?
11
+
12
+ if [ $EXIT_CODE -ne 0 ]; then
13
+ echo
14
+ exit $EXIT_CODE
15
+ fi
16
+
17
+ echo
18
+
19
+ # run slow tests only when all other tests have passed
20
+ echo "[SLOW TESTS]"
21
+ echo
22
+
23
+ uv run pytest --ignore="./.git" -m "slow" "$@"
24
+ EXIT_CODE=$?
25
+
26
+ if [ $EXIT_CODE -eq 5 ]; then
27
+ echo
28
+ echo "No tests selected."
29
+ EXIT_CODE=0
30
+ fi
31
+
32
+ if [ $EXIT_CODE -ne 0 ]; then
33
+ echo
34
+ exit $EXIT_CODE
35
+ fi
36
+
37
+ ./script/lint
38
+ EXIT_CODE=$?
39
+
40
+ if [ $EXIT_CODE -ne 0 ]; then
41
+ exit $EXIT_CODE
42
+ fi
@@ -0,0 +1,25 @@
1
+ Write-Output ""
2
+ Write-Output "[QUICK TESTS]"
3
+ Write-Output ""
4
+
5
+ # run quick tests first
6
+ uv run pytest --ignore=".\.git" -m "not slow" $args
7
+
8
+ If (-Not $?)
9
+ {
10
+ exit
11
+ }
12
+
13
+ Write-Output ""
14
+ Write-Output "[SLOW TESTS]"
15
+ Write-Output ""
16
+
17
+ # run slow tests only when all other tests have passed
18
+ uv run pytest --ignore=".\.git" -m "slow" $args
19
+
20
+ If (-Not $?)
21
+ {
22
+ exit
23
+ }
24
+
25
+ . ".\script\lint.ps1"
@@ -0,0 +1,13 @@
1
+ #! /bin/bash
2
+
3
+ echo
4
+
5
+ uv sync --upgrade
6
+ EXIT_CODE=$?
7
+
8
+ if [ $EXIT_CODE -ne 0 ]; then
9
+ echo
10
+ exit $EXIT_CODE
11
+ fi
12
+
13
+ echo
@@ -0,0 +1,5 @@
1
+ Write-Output ""
2
+
3
+ uv sync --upgrade
4
+
5
+ Write-Output ""