Commit graph

148 commits

Author SHA1 Message Date
renovate[bot]
8c92c0d4de
Update dependency rich to v14 2025-03-30 14:51:29 +00:00
Jrnl Bot
7249adb232 Increment version to v4.2.1 2025-02-25 05:02:27 +00:00
Jonathan Wren
e2a62e99a0
Update dependency pytest to >=8.1.1 (#1974)
* update pytest in deps

* update lock file

* update lock file
2025-02-24 20:47:32 -08:00
Carl Smedstad
1530ad39a1
Update pytest-bdd to v8.0 (#1955)
* Encapsulate all multiline strings in triple-quotes in Gherkin files

Since pytest-bdd v8.0.0 uses the official Gherkin parser, multiline
strings must now be encapsulated by triple-quotes.

See:
- https://pytest-bdd.readthedocs.io/en/stable/#id2
- https://pytest-bdd.readthedocs.io/en/stable/#docstrings

* Remove comments in Gherkin files causing test breakage

These comments break the step matching.

* Fix compatibility of step-functions matching on multiple lines

In pytest-bdd v8.0.0 it is no longer possible to match based on multiple
lines, which breaks essentially all steps that support docstrings. Solve
this by adding a wrapper-function for each of these instances, that
matches the docstring step, and calls the original function.

So, what used to be:

    @then(parse("the output should match\n{regex}"))
    @then(parse('the output should match "{regex}"'))
    def output_should_match(regex, cli_run):
        ...

Is now:

    @then(parse("the output should match"))
    def output_should_match_docstring(cli_run, docstring):
        output_should_match(docstring, cli_run)

    @then(parse('the output should match "{regex}"'))
    def output_should_match(regex, cli_run):
        ...

There is possibly a way around this that is much better than what I've
done here, but this is a start at least.

* Update version requirement of pytest-bdd to >=8.0

* Update tox config to match poetry config

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2025-02-24 20:16:54 -08:00
Jrnl Bot
ba18bed4d7 Increment version to v4.2 2024-11-17 23:53:30 +00:00
Jrnl Bot
16a0f043b1 Increment version to v4.2-beta 2024-10-19 22:04:52 +00:00
Micah Jerome Ellison
96d89ca9d5
Add Python 3.13 support (#1930)
* Allow Python 3.13 in pyproject

* Add Python 3.13 to GitHub actions

* Run `poetry update`

* fix failing test

* update poetry.lock

* update poetry.lock again

---------

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2024-10-01 20:29:06 -07:00
renovate[bot]
17e1ba60e5
Update dependency ruff to v0.6.8 (#1900)
* Update dependency ruff to v0.6.8

* Run `ruff check .` instead of `ruff .` due to ruff error

* Preface ruff lint keys with .lint to address ruff deprecation warning

* Changes to appease ruff linter

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2024-09-30 18:10:49 -07:00
Ben Beasley
48b61f6953
Support pytest_bdd 7.1.2 and later (#1878)
* Support pytest_bdd 7.1.2 and later

Fix #1875.

* Prevent use of pytest 8.1 for now due to unrelated error

* poetry lock --no-update

---------

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2024-03-28 08:08:00 -07:00
Jrnl Bot
65070cb675 Increment version to v4.1 2023-11-04 19:35:55 +00:00
Jrnl Bot
aca0a185b7 Increment version to v4.1-beta2 2023-10-31 01:53:15 +00:00
Jrnl Bot
296c459252 Increment version to v4.1-beta 2023-10-29 20:34:08 +00:00
Micah Jerome Ellison
721167a079
Resolve parsedatetime "flag style" DeprecationWarning (#1818)
* Stop ignoring parsedatetime warning flag style warning
* Use new VERSION_CONTEXT_STYLE to bypass parsedatetime flag style warning
* Replace "flag" and its magic numbers with contextual booleans
2023-10-29 13:27:53 -07:00
renovate[bot]
6962c399ea
Update dependency ruff to v0.0.287 (#1778)
* Update dependency ruff to v0.0.287

* add ruff target version to tailor linting to our required python versions

* fix linting issues

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-09-09 15:44:46 -07:00
Micah Jerome Ellison
cb69bb474c
Use rich instead of ansiwrap to wrap text (#1693) 2023-07-29 14:36:43 -07:00
Micah Jerome Ellison
34c7903300
Replace flake8 and isort with ruff linter and add black --check to linting step (#1763)
* Add ruff

* Add ruff config

* Add ruff rules that look useful and are already passing

* Add more ruff rules after talking with Jonathan

* Add line length exception for acceptably long indented line

* Resolve ruff line length 88 rule in args. Changing small lines but adding a noqa ignore directive to longer lines that look best as they are. Their dedented length is still less than 88

* poe format

* Resolve all remaining ruff line length errors

* Replace flake* and isort with ruff calls

* Add black --check as final lint step. ruff catches most but not all black formatting issues

* Remove unneeded flakeheaven setting

* Remove flake* and isort now that ruff is handling all their business

* Update pyproject, lockfile with latest version of ruff

* Document each ruff rule with comment

* Add black --version call before black --check

* Remove extraneous period
2023-07-15 12:35:10 -07:00
Jrnl Bot
4f1a21819d Increment version to v4.0.1 2023-06-20 23:39:40 +00:00
Jrnl Bot
649254d0ac Increment version to v4.0.1-beta 2023-05-20 23:34:50 +00:00
Micah Jerome Ellison
4a7057c038
Refactor --template code (#1711)
* Move path concerns to path.py and template concerns to editor.py -- BDD tests are failing
* Move path-related constants from config.py to path.py
* Mock get_templates_path in its new calling file
* Mediate template arg vs. config in controller then read template text in editor and unify those two use cases.
Some tests still failing
* Fix test whose message had changed
* poe format
* Refactor for easier unit testing and add unit tests
* Use path strings instead of Path objects in return values to prevent side effects that caused unit tests to fail on some platforms
* poe format
* Attempt to bypass getcwd errors in CI with patch
* Consistently use strings for paths instead of some strings and some pathlib.Path
* Keep pathlib within a function for readability
* fix for ruamel.yaml versions >=0.17.22
* Run poe format

---------

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-05-20 16:13:24 -07:00
Jrnl Bot
e987e34c78 Increment version to v4.0 2023-05-20 20:35:57 +00:00
Jonathan Wren
0b55c477e1
Lock ruamel.yaml version until bug is fixed (#1738) 2023-05-06 17:02:55 -07:00
Jrnl Bot
adeb1acced Increment version to v4.0-beta3 2023-04-29 22:51:01 +00:00
Jrnl Bot
8d95e0bfe9 Increment version to v4.0-beta2 2023-04-22 20:46:35 +00:00
Jrnl Bot
deef870213 Increment version to v4.0-beta 2023-03-25 23:04:23 +00:00
Micah Jerome Ellison
1a67fd5dec
Use pytest-bdd 6 (#1685)
* update pytest-bdd to 6.0
* update lock file
* fix first test (inject command fixture to request)
* fix some more tests
* fix cli_run fixture
* fix password fixture
* Remove unused import
* Fix greedy should_or_should_not parsing problems while also consolidating its parse/transformation-to-bool code
* Prevent greedy matching in "we run" by using regular expression lookahead
* Add missing "Outline" in scenario outlines with examples
* Split "we use the config" and "we use no config" so pytest won't try to consume config_file as a fixture
* Fix missing ShouldOrShouldNot
* Formatting
* fix get_fixture function
* change output of failing test to be a little more useful
* update lock file
* update type builder to for should/should not to be in it's own file, rename some vars for readability
* add parse-type new dev/testing dependency
* update lock file

---------

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-03-04 12:37:06 -08:00
Micah Jerome Ellison
d81b5ad955
Support mkdocs 1.4.2 and fix its missing breadcrumb (#1691)
* Use latest mkdocs version 1.4.2
* Add docs_theme to mkdocs watch so it automatically reloads localhost when modifying theme
* Bring in ReadTheDocs breadcrumb theme and fix display issues around "Docs" root breadcrumb
* The problem is CSS, not the breadcrumbs template. Tightly scope offending CSS and remove breadcrumbs template override
* Bring mkdocs ReadTheDocs breadcrumbs theme back in
* Fix pa11y validation issue by replacing breadcrumb a alt attribute with aria-label
* Attribute source of new breadcrumbs file
* Use mkdocs 1.4 or greater with no upper bound
2023-02-25 12:16:33 -08:00
Jonathan Wren
fff05eb646
Refactor flow for easier access to some files (avoid things like jrnl.Journal.Journal and jrnl.jrnl co-existing) (#1662)
* run format

* rename cli.py to main.py

* rename jrnl.py to controller.py

* move journal class files into journals dir

* rename start -> run in controller.py
2023-01-14 14:42:29 -08:00
renovate[bot]
a6f2d34b7e
Update dependency rich to v13 (#1654)
* Update dependency rich to v13

* Update pyproject.toml

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-01-07 13:59:40 -08:00
Jonathan Wren
b508ed6c9a
Add simplify plugin to linting checks (#1630)
* add simplify plugin for flakeheaven

* update lock file

* fix linting issues in current codebase
2022-11-05 15:56:46 -07:00
Jonathan Wren
c1eb0c54a3
Add type-checking plugin to linting checks (#1629)
* add type-checking plugin for flakeheaven

* update lock file

* fix type-checking issues in current codebase

* run linters
2022-11-03 07:18:35 -07:00
Jonathan Wren
51e9ce5638
Move existing linting into flakeheaven (#1628)
* add black and isort to flakeheaven

* update lock file

* clean up poe config

* run formta on python blocks in markdown file

* disable code for black being confused about markdown

* add cache timeout for flakeheaven

See: https://github.com/flakeheaven/flakeheaven/issues/71
2022-10-31 09:31:17 -07:00
Micah Jerome Ellison
74b7ac834e
Drop Python 3.9 and use Python 3.11 official release (#1611)
* Drop Python 3.9 and use Python 3.11 release instead of pre-release
* Run poetry lock
* Fix need for quoted 3.10 string
* Use 3.11.0-rc.2 for Python 3.11 for now
* Update minimum Python version in installation docs
* Change Python 3.11 RC version to 3.11
* Run docs and release workflows on Python 3.11
* Including Python 3.12 in allowable versions
* Restore poetry.lock from develop
* Run poetry lock --no-update
* Retrieve poetry.lock from develop and lock with --no-update
* poetry lock --no-update
2022-10-29 14:36:50 -07:00
Jonathan Wren
a77a3d5a56
Replace flake8 with flakeheaven in linting steps (#1625)
* replace flake8 with flakeheaven

* update pyproject.toml for new flake tool

* update lock file

* change flake8 to flakeheaven in tests

* undo fix for poetry

* remove unused plugin marker for flakeheaven

* remove unused import in markdown file

* Attempt to exclude .venv from flakeheaven runs in CI

* Exclude more dirs from flakeheaven

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-10-29 14:21:11 -07:00
Jrnl Bot
415fc336ec Increment version to v3.3 2022-10-29 19:19:53 +00:00
Jrnl Bot
ffdd4f923d Increment version to v3.3-beta2 2022-10-22 22:38:31 +00:00
Jrnl Bot
41e5d5ffff Increment version to v3.3-beta 2022-10-08 20:49:59 +00:00
Jrnl Bot
55e0162a87 Increment version to v3.2 2022-09-03 19:07:07 +00:00
Jrnl Bot
a107c868a0 Increment version to v3.2-beta 2022-08-27 19:40:35 +00:00
Jrnl Bot
b26fdb424b Increment version to v3.1 2022-08-21 22:22:00 +00:00
Jonathan Wren
671f403602
Fix docs pipeline, make docs tests easier to run locally and on different OSes (#1554)
* update docs pipeline to use poe task runner

* move npm dependency into package.json file instead of hardcoding into pipeline

* replace nix-specific call with python version (for windows compat)

* update commands to use python for win compat

* update lock file

* change deps to take out xq and use xmltodict instead

* move script tasks from pyproject into new tasks.py

* run linting on new tasks.py file

* fix typo

* clean up pyproject to make valid toml

* update docs with correct task runner command

* use npx in case node_modules/.bin isn't in the path

* Run pa11y-ci in cross-platform manner (works on Windows)

* Add node_modules to .gitignore

* clean up poe alias

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-08-21 13:47:25 -07:00
Jrnl Bot
6f4e669e0d Increment version to v3.1-beta2 2022-08-13 21:03:51 +00:00
Jrnl Bot
6ade0da597 Increment version to v3.1-beta 2022-07-30 19:51:10 +00:00
outa
62f65ce3b9
Update tzlocal to v4.x and remove pytz dependency (#1528)
* Update tzlocal to v4.x and remove pytz dependency
* Avoid `unwrap_shim` method
* Remove upper bound of tzlocal version
2022-07-30 12:46:43 -07:00
Jonathan Wren
c45bed7f6c
Disable gherkin reporter to fix failing test suite (#1540) 2022-07-16 14:13:48 -07:00
Jrnl Bot
50b320063a Increment version to v3.0 2022-07-09 19:02:32 +00:00
Jonathan Wren
db6f80d721
Limit pytest-bdd to <6.0 to temporarily avoid breaking changes (#1536)
This will unblock other tests for now
2022-07-09 11:54:15 -07:00
Jrnl Bot
97cb7a678e Increment version to v3.0-beta2 2022-06-25 21:46:02 +00:00
Jonathan Wren
0f2962a95f
Add and run isort on Python files (#1520)
* add and run isort

* udpate more import statements

* fix typo
2022-06-25 14:43:32 -07:00
Jonathan Wren
20254f7434
Run tests in parallel (#1519)
* Clean up pyproject file

This reduces the differences between local tasks and tasks run in the CI
pipelines

* remove linting step (it's part of test now)

* remove useless arg

* add xdist for parallel test execution in pytest
2022-06-25 13:12:52 -07:00
Jonathan Wren
23bc0f2c8f
Reduce difference between local and CI environments (#1518)
* Clean up pyproject file

This reduces the differences between local tasks and tasks run in the CI
pipelines

* remove linting step (it's part of test now)

* remove useless arg
2022-06-25 12:45:39 -07:00