-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Require use of new +placeholder+ syntax for figuring out which commands need to be replaced with macros/versioned aliases/full paths * Clean up multi-statement vs single command handing for Alpine, Arch and Fedora * Prevent rpmbuild's parser freaking out if test_command contains % or \n\n * Replace indentation with the distribution's preferred width and choice of tabs vs spaces
- Loading branch information
Showing
15 changed files
with
141 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,18 +168,24 @@ maintainer: Your Name <[email protected]> | |
# non-ambiguous, `polycotylus` will default to the ``project.maintainer`` | ||
# field in the ``pyproject.toml``. | ||
|
||
test_command: pytest -k 'not unrunable_test' | ||
# The verification command, defaulting to ``pytest``. This command will be | ||
test_command: +pytest+ -k 'not unrunable_test' | ||
# A verification command, defaulting to ``+pytest+``. This command will be | ||
# invoked using ``sh`` from the root of a copy of your project but note that | ||
# only the files listed in `test_files` will be available when `polycotylus` | ||
# runs its end to end test. If you want to invoke Python, use ``python`` and | ||
# not ``python3`` or ``/usr/bin/python`` so that `polycotylus` can replace | ||
# ``python`` with whatever s̶i̶l̶l̶y̶ ̶m̶a̶c̶r̶o̶ *abstraction* each RPM based | ||
# distribution insists on using. Note that ``python -m unittest`` is supported | ||
# but strongly discouraged in favour of `pytest's unittest support`_ due to | ||
# its rather dangerous behaviour of not failing if no tests are found. | ||
# runs its end to end test. To accommodate distributions that like to | ||
# perpetuate `xkcd 1987`_, annotate commands coming from Python environments | ||
# by wrapping then in plus signs. i.e. Use ``+python+`` instead | ||
# ``python``/``python3`` or ``+pytest+`` instead of ``pytest`` so that | ||
# `polycotylus` can substitute them for whatever s̶i̶l̶l̶y̶ ̶m̶a̶c̶r̶o̶ *"abstraction"* | ||
# each RPM based distribution uses. Note that ``+python+ -m unittest`` is | ||
# supported but strongly discouraged in favour of `pytest's unittest support`_ | ||
# due to its rather dangerous behaviour of not failing if no tests are found. | ||
# Testing can be disabled by setting `test_command` to an empty string | ||
# although, in the absence of a proper test suite, even a dumb ``+python+ -c | ||
# 'import my_package'`` is a lot better than nothing. | ||
# | ||
# .. _`pytest's unittest support`: https://docs.pytest.org/en/7.3.x/how-to/unittest.html | ||
# .. _`xkcd 1987`: https://xkcd.com/1987/ | ||
|
||
test_files: | ||
- tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
test_command: python -m unittest discover tests 2>&1 | grep 'Ran 1 test' | ||
test_command: +python+ -m unittest discover tests 2>&1 | grep 'Ran 1 test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The [36mtest_command[0m contains no Python command placeholders. Polycotylus requires executables from Python environments to be marked as such by wrapping them in plus signs. E.g. replace [32mpython[0m with [32m+python+[0m or [32mpytest[0m with [32m+pytest+[0m. Wrapper scripts or tools like tox can not be used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ dependencies: | |
pip: pytest | ||
|
||
test_command: | | ||
pytest | ||
+pytest+ | ||
stat polycotylus.yaml || print_hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters