Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heresy refactor #2

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open

Heresy refactor #2

wants to merge 40 commits into from

Conversation

m000
Copy link
Owner

@m000 m000 commented Nov 4, 2023

No description provided.

m000 added 13 commits November 3, 2023 22:15
…(jj2cli).

The upstream [1] appears to have fallen in disrepair.
In the meantime, this fork has implemented additional functionality and
alternative (and arguably more flexible) approaches to some use cases.
At this point, a merge with the upstream is unlikely to happen and it will
become even more likely with each future commit.

Starting with this commit, this fork will be developed independently
and under a new name to reflect the additional capabilities (and
incompatibilities).

[1] https://github.com/kolypto/j2cli
Removed the obsolete implementation of read_context_data().
Convert return data to dict. Down the line, the data are iterated using
six.iteritems(), which does not support iterating over a filter.
Allows selecting any of the available Jinja2 behaviours (strict, normal,
debug) for handling missing variables.
Useful for aligning trailing line comments in a block of text.
Allows looking up a string in the context.
…c behaviour!

The old code was making an attempt to work with any part of the
data spec missing:
    - data_in:json would interpret the contents of data_in as json.
    - data_in:foo would interpret the contents of data_in as the
      fallback format, and attach them to "foo" in the context.

This resulted in the code being complicated, and also not working
as expected in some cases. For this, it was decided to simplify the
data spec format as <source>|[<source>]:[<format>[:<context_dest]].
Any parts not-required can be ommitted.

The previous examples in the new format can be written as:
    - data_in:json
    - data_in::foo or data_in:?:foo

The order of format and context_dest parts has been reversed, as the
format part will probably be used more often.
@m000 m000 force-pushed the heresy-refactor branch 6 times, most recently from 16a4bec to 2f711ae Compare November 5, 2023 20:46
m000 added 9 commits November 5, 2023 23:50
Discontinued:
  - setuptools (using poetry and pyproject.toml from now on)
  - Travis CI (won't bother contacting support to fix my account [1])
  - nose (does not seem to be actively maintained [2])
  - six (
  - .python-version (used by pyenv)

Updated:
  - tox configuration to use Python >=3.10
  - .gitignore
  - make targets for development/testing

Now using:
  - poetry
  - github actions
  - pytest

[1] https://archive.ph/lOFGT
[2] https://pypi.org/project/nose/#history
…README.md.

Extended documentation moved under docs directory.
@m000 m000 force-pushed the heresy-refactor branch 6 times, most recently from 6229fde to 3e07fd7 Compare November 12, 2023 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant