Commit graph

98 commits

Author SHA1 Message Date
Karl Voit
e9e7936c74
Merge pull request #26 from nbehrnd/dev
reorganization around a `pyproject.toml` file
2025-05-09 09:17:44 +00:00
Norwid Behrnd
abd9bbfa90 docs: update READMEs
PyPI accepts READMEs only in the file format of GitHub flavored
Markdown .md, or reStructured text, .rst.  With Pandoc, the
updated .org file is translated into the former syntax.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2025-05-07 18:05:50 +02:00
Norwid Behrnd
579ce63756 build: reorganize project dependencies with a .toml file
The dependencies of the project -- either use (default), or
further development (`dev`) -- are managed by a pyproject.toml
file.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2025-05-07 18:05:39 +02:00
Norwid Behrnd
1eed973fc2 test(pytest.yml): update scope of Image runners
The scope of the environments the pytest checks are performed
was updated (ubuntu-24.04, macos-15, windows-2025; Python 3.9
and 3.13).  The checks now equally are available on push to a
non default branch `dev` (development/feature branch).

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2025-05-07 17:09:04 +02:00
nbehrnd
683be702bb
Merge pull request #24 from nbehrnd/master
lint pytest tests' setup
2024-11-22 11:30:03 +01:00
Norwid Behrnd
956088b982 refactor: lint pytest tests's setup
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-22 11:18:04 +01:00
Norwid Behrnd
78157342b7 refactor: rewrite pattern search, smart-prepend option
The pattern search about the smart-prepend option was rewritten to
be easier to read and maintain.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-22 11:01:37 +01:00
Norwid Behrnd
62bf545c0c style: edit test series 'default' for compactness
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-21 21:22:10 +01:00
Norwid Behrnd
045f946439 style: more compact generation of pytest.ini
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-21 21:25:50 +01:00
Norwid Behrnd
548f4f848e style: remove Makefile no longer used
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-21 21:13:37 +01:00
Norwid Behrnd
052ca37939 style: lint tests against flake8
Tests were linted with flake8 (7.1.1 (mccabe: 0.7.0, pycodestyle:
2.12.1, pyflakes: 3.2.0) CPython 3.12.7).

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-21 21:11:31 +01:00
nbehrnd
3b82ea43e8
Merge pull request #23 from nbehrnd/master
fix: corrections and edits on pytests installed
2024-11-12 18:30:36 +01:00
Norwid Behrnd
781ba797a4 fix: corrections and edits on pytests installed
Errors in the previous set of pytest tests were removed.  A different
setup of the pytest.yml file is installed to ease testing on
multiple OSes (GitHub runners) against multiple versions of Python
interpreters.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-12 18:22:12 +01:00
Norwid Behrnd
3b8493bb62 ci(pytest.yml): adopt matrix syntax of GitHub actions
The pytest based testing is redefined adopting tmatrix based syntax
GitHub offers.  This eases to track which versions of OSes and Python
interpreters are engaged, and a format is more compact, than the one
used earlier.  Inspired/partially copy-pasted from a project related
to chemistry.[1]

[1] https://github.com/nbehrnd/datawarrior_saturate_Murcko_scaffolds

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-12 18:16:05 +01:00
Norwid Behrnd
f79abfe062 test: correct pytest regex, test_smart_prepend
The regex condition did not match the pattern previously established
by Karl Voit -- erroneously, it would fail on the 30th and 31st of
each relevant month expressed with the short date stamp (YYMMDD) of
date2name.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-12 18:06:31 +01:00
Norwid Behrnd
82bfd8e66e test(pytest.ini): correct a functional typo
Because it is `markers` and not `Markers`, the earlier version
caused `pytest` to issue a warning.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-12 18:00:44 +01:00
nbehrnd
2b13f3ba35
Merge pull request #22 from nbehrnd/master
extend rebuild of pytest to prepend and smart-prepend mode
2024-11-06 00:23:48 +01:00
Norwid Behrnd
297ee62bbc fix: rebuild pytest sections 2 and 3 for Linux and Windows
The second and third section of the pytest tests were rewritten
to be more portable for either Linux Debian 13, or Windows 10.

As confirmed during this revision, the outcome of the optional
--smart-prepend mode still depends on the format of the leading
time stamp.

Second, special characters presumed to provide a file name without
a white space (for instance the underscore), though working well in
Linux Debian, are not reliably processed in Windows.  To facilitate
a subsequent refactoring of appendfilename, the corresponding tests
already are present, however currently muted.

Thirdly, the reinstallment of pytest.ini and labels allows again
to address the pytest tests by the name of their set: default,
prepend, and smart.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-06 00:07:58 +01:00
Norwid Behrnd
fa5c36d9a0 ci(pytest.yml): correct sequence definition
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-06 00:04:47 +01:00
Norwid Behrnd
0d1dc9ac15 docs(test_generator.org): update test documentation
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-05 23:14:42 +01:00
Norwid Behrnd
07319a2726 ci: split pytest runs (default, prepend, smart)
With pytest labels installed (default, prepend, smart) it will be
easier to recognize which sub set contains a failing test.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-05 22:12:18 +01:00
Norwid Behrnd
39364a6aef test: reinstall pytest.ini / label test sets
Previously present labels to check appendfilename's work in either
default, prepend, or smart prepend pattern as well as file
pytest.ini are reinstalled again.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-05 22:04:29 +01:00
Norwid Behrnd
a3cd2a441e refactor: edit tests to smartly prepend a string
The third section of tests about smartly prepending a string -- i.e.
to insert a string right after the time or date stamp -- was edited.
Manual tests in Linux Debian and Windows 10 as well as with pytest
on either operating system confirm inconsistencies of the format
of the file name eventually generated.[1,2]

In addition, the implementation differs in robustness to deploy
special characters like for instance the underscore as a separator
to enclose the string to add.  Instead of `_` (as in Debian), Windows
tends to enclose these separators with single quotes (`'_'`) instead.
The default by `appendfilename` to use a single blank character
still is considered "safe to be used" _for `appendfilename`_ though
e.g. the underscore would represent a safe alternative if file names
with white space are not acceptable.

[1] https://github.com/novoid/appendfilename/issues/15
[2] https://github.com/novoid/appendfilename/issues/16

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-05 16:17:35 +01:00
Norwid Behrnd
f4a4027b1c style(__init__.py): label regex strings as such
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-04 19:44:27 +01:00
Norwid Behrnd
a9498889bc docs: docs: update documentation, second set of tests
Documentation about the second set of tests (prepend a string to
the original file name of a file) was updated.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-03 20:04:37 +01:00
Norwid Behrnd
3e9786f62c refactor: edit tests to prepend a string
In similar pattern to the first section (append a string), the
tests of the second section (to prepend a string to the orginal
file name) are revised for better portability on different
operating systems.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-03 19:50:41 +01:00
Norwid Behrnd
efdb8b33e7 docs: update documentation, first set of tests
Documentation about the first set of tests (default append of a string
to the file's file name) was updated.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-03 19:17:01 +01:00
Norwid Behrnd
2341fb1d89 refactor: edit tests about default append of a string
The checks about appendfilename's default, i.e. to insert a string
just prior to the file extension were edited.  This aims to provide
better portability of the tests when launching pytest either in
Linux Debian 13/trixie, or Windows 10.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-11-03 19:13:58 +01:00
nbehrnd
140671f28f
correct functional typo in pytest.yml 2024-10-31 12:05:12 +01:00
nbehrnd
afdc9a1e57
Merge pull request #21 from nbehrnd/pytest_add_oses
ci(pytest.yml): extend scope to Windows and MacOS
2024-10-31 12:02:36 +01:00
Norwid Behrnd
7c7074d0f9 ci(pytest.yml): extend scope to Windows and MacOS
The scope of the automated pytest checks is extended to equally
consider Windows 2022 and MacOS 14.  At present, these are the
most recent OS images of Windows, or MacOS, respectively.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-10-31 11:58:59 +01:00
nbehrnd
72a9c1179a
Merge pull request #20 from nbehrnd/rebuild_pytest 2024-10-31 11:46:19 +01:00
nbehrnd
09903e82fb
Merge branch 'master' into rebuild_pytest 2024-10-31 11:45:27 +01:00
Norwid Behrnd
d79ba9d954 ci(pytest.yml): introduce github action on ubuntu
This commit aims to provide an automated testing with pytest moderated
by GitHub actions.  Its scope is constrained twice -- both for pytest,
as well as for the testing operating system -- to familiarize

1) how to file a PR to project I don't own which however now allows
   me to admit a PR.
2) To learn if in this situation a contributor can set GitHub actions
   in a repository owned by an other user.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-10-31 11:30:30 +01:00
Norwid Behrnd
a2a9323063 fix(test_generator.org): rewrite first portion of pytest tests
The export by tangle from the org file is constrained to the first
set of tests by pytest.  This section is rewritten to yield a more
portable format to work either for Linux Debian, or Windows 10.

Running

```shell
python -m pytest
```

in their respective virtual environments, the set of 60 items to
test all pass (Debian: Python 3.12.6, pytest 8.3.3; Windows 10:
Python 3.12.4, pytest 8.3.3).

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-10-31 11:13:26 +01:00
Norwid Behrnd
c89aa42418 fix(requirements.txt): update and extend scope
By now, an update/move to `pyreadline3` is sensible (as already in
the principal branch).  Extension with `pytest` offers an optional
test on site.

In Linux Debian 13/trixie (virtual environment of Python 3.12.4 and
pytest 8.3.3), out of 540 tests all 540 pass, and 4 are tagged
with a warning.  Pylint (3.3.1)/astroid (3.3.5) indicate a couple of
possible improvements (r strings, etc.) and hence rate
test_appendfilename.py with 6.21/10 -- but does not report a syntax
error.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-10-31 10:28:49 +01:00
Karl Voit
c8029b9518 introduced DEBUG_SEPARATOR
instead of using strings
2024-10-23 11:34:21 +02:00
Karl Voit
81ffa33e00
Merge pull request #19 from nbehrnd/fix_pyreadline3
fix(requirements.txt): move from pyreadline to pyreadline3
2024-10-23 09:30:34 +00:00
Norwid Behrnd
55c17c2247 fix(requirements.txt): move from pyreadline to pyreadline3
Module `pyreadline3`, a fork of `pyreadline` no longer actively
maintained on PyPI replaces its predecessor.  This equally aims
to account for an reported problem using the utility in Windows.[1]

[1] https://github.com/novoid/appendfilename/issues/18

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
2024-10-22 17:59:40 +02:00
Karl Voit
c04aee6c5e
Merge pull request #14 from nbehrnd/tester
extend tester's pattern to all five provided by date2name
2022-01-12 11:16:37 +01:00
Norwid Behrnd
a282a32a0e extend patten timestamps by date2name, 2/2
Addition of the pattern --compact, --month, and --short.
2022-01-09 13:20:42 +01:00
Norwid Behrnd
c44d7070c4 reorganize test section --smart-prepend for extension
Ahead of the addition of checks about three stamp pattern issued
by date2name, the checker about appendfilename's the option
--smart-prepent is reorganized to be more compact/easier to be
read.  For now, this outweights each filename being checked twice.
2022-01-09 11:25:06 +01:00
Norwid Behrnd
903b6adbe0 extend pattern timestamps by date2name, 1/2
This extends the pattern tested to consider all five stamp formats
issued by date2name when passing appendfilename either in default,
or prepend mode.  It doesn't yet the --smart-prepend mode as third
option.
2022-01-09 11:08:56 +01:00
Norwid Behrnd
49254c4429 clarify the call sign issue of pytest
Depending on the installation/Linux distribution used, pytest for
Python 3 may be invoked by either pytest, or pytest-3.  The issue
is addressed.
2022-01-09 10:54:05 +01:00
Norwid Behrnd
e28078103b update changes by K Voit/master into tester 2022-01-08 17:06:07 +01:00
Karl Voit
b2be04e913 more debug output for smartprepend feature 2022-01-07 17:11:11 +01:00
Karl Voit
4cc3b34ee5 more debug output for smartprepend feature 2022-01-07 17:04:22 +01:00
Karl Voit
f423f93e19
Merge pull request #12 from nbehrnd/tester
Cherry-pick from cebc8c42
2022-01-07 16:02:04 +01:00
Norwid Behrnd
c9ef4864c0 Cherry-pick tester-time (0291b2d), d2n time stamps
Checks of appendfilename --smart-prepend now consider date2name'
default time stamp (YYYY-MM-DD), the by date2name --withtime
(YYYY-MM-DDTHH.MM.SS), or absence of such by pattern recognition
with regular expressions.
2022-01-07 11:10:27 +01:00
Norwid Behrnd
1f1292d04a Cherry-pick from cebc8c42
For programmatic testing of appendfilename, a test generator
is written.  This tangles a Makefile, a pytest.ini and the
test script.  Despite the incomplete coverage of this approach,
an inconsistency in appendfilename's interaction on files with
the simple YYYY-MM-DD timestamp (date2name) is spot.
2022-01-06 16:09:05 +01:00