Readme tools samples#9
Readme tools samples#9NeilGirdhar merged 1 commit intoNeilGirdhar:masterfrom jtmoon79:README-tools-samples
Conversation
|
@NeilGirdhar any opinion on this PR? |
README.rst
Outdated
|
|
||
| This repository provides a Python base class, and various decorators for specifying promises relating to inheritance. | ||
| It provides three inheritance patterns: | ||
| This repository, ``ipromise``, provides a Python base class and |
There was a problem hiding this comment.
Either say "this repository" or "I Promise". Just choose one.
README.rst
Outdated
| This repository provides a Python base class, and various decorators for specifying promises relating to inheritance. | ||
| It provides three inheritance patterns: | ||
| This repository, ``ipromise``, provides a Python base class and | ||
| decorators to guarantee inheritance "promises". |
There was a problem hiding this comment.
Okay, this is good, but no need for the quotations around "promises".
README.rst
Outdated
|
|
||
| * implementing | ||
| * overriding | ||
| * augmenting |
There was a problem hiding this comment.
Keep the commas and the "and". This is still a sentence.
README.rst
Outdated
| * overriding | ||
| * augmenting | ||
|
|
||
| Using the ``ipromise`` inheritance patterns can ensure an inheritance hierarchy |
There was a problem hiding this comment.
I think this para is redundant. It doesn't say anything the previous paragraph doesn't. "Build time" doesn't mean anything in Python either.
There was a problem hiding this comment.
I really preferred this as it explains the mechanism by which ipromise works. Not all Python users may intuit how ipromise functions.
I can remove it if you'd still prefer it removed.
There was a problem hiding this comment.
Fixed "build time".
tools/flake8.sh
Outdated
| # | ||
| # run flake8 with project settings | ||
|
|
||
| set -eu |
There was a problem hiding this comment.
What does this file add? I just do this:
poetry install
poetry shell
pflake8 .I don't think we need complicated scripts for people who don't know how to use poetry.
There was a problem hiding this comment.
I adjusted the install script help instructions to the general poetry steps.
The wrapper scripts handle the details for developers:
- running from the correct path
- explicitly specifying a config file
- passing expected arguments
- sanity check the program exists and can run
--version
IME wrapper scripts like this greatly reduce confusion around running project tools.
Also, having these tool wrapper scripts is like a big hint "make sure to run these tools with these settings!".
Also, in my case, some poetry commands failed with what appears to be a poetry bug. I had to come up with some workarounds. For example, sometimes I would get
$ poetry install
Updating dependencies
Resolving dependencies... (4.1s)
ValueError
invalid literal for int() with base 10: b''
at .venv-3.9.13_ubuntu-22.04/lib/python3.9/site-packages/cachy/stores/file_store.py:65 in _get_payload
61│
62│ with open(path, 'rb') as fh:
63│ contents = fh.read()
64│
→ 65│ expire = int(contents[:10])
The slightly unusual command-lines in the "tools" scripts were what worked for me most often. My updates to this PR removed my uncommon approach.
Check out the updated "tools" scripts in my update push.
If you'd still like the "tools" scripts removed then I will remove them.
tools/mypy.sh
Outdated
|
|
||
| set -eu | ||
|
|
||
| cd "$(dirname -- "${0}")/.." |
There was a problem hiding this comment.
Same, i don't think this file helps. I just do
mypy ipromise
There was a problem hiding this comment.
Currently, I recommended two paths for mypy, ipromise and test. mypy passes.
There was a problem hiding this comment.
Then just do mypy ipromise tests. You can add that to the readme?
tools/pytest.sh
Outdated
| set -eu | ||
|
|
||
| cd "$(dirname -- "${0}")/.." | ||
|
|
tools/rst-lint.sh
Outdated
| set -eu | ||
|
|
||
| cd "$(dirname -- "${0}")/.." | ||
|
|
There was a problem hiding this comment.
This is good information. Would you mind putting this line:
rst-lint --level info README.rstinto the readme itself? You could add information about runnning mypy. pflake8, etc. there too? Maybe create a new section?
There was a problem hiding this comment.
There is currently section Development which refers to these scripts. Is that adequate?
There was a problem hiding this comment.
Yes, sounds great. Would you mind adding this line to that section?
|
I squashed the force-pushed the commits (which messes up the PR review history above 😕 but is a cleaner commit to |
|
@jtmoon79 Thanks, can you remove the scripts? I still see them. |
Whoops, for some reason the |
README.rst
Outdated
|
|
||
| .. code-block:: shell | ||
|
|
||
| pip install restructuredtext_lint Pygments |
There was a problem hiding this comment.
This install should be in pyproject. If it isn't working for you, there's something wrong with your poetry setup.
| python -m pip install ipromise | ||
|
|
||
| *** | ||
| Use |
| print("MyClassAgumentedOnceAgain().f()") | ||
| return super().f(**kwargs) | ||
|
|
||
| MyClassAgumentedOnce().f() |
Revise README.rst to use syntax sections recommended in https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#sections Improve README opening to better explain `ipromise`. Add table of contents. Revise README.rst line widths. Add easier-to-read sample code, both in README and in python files under `samples/`.
|
@NeilGirdhar how about this round of updates? |
NeilGirdhar
left a comment
There was a problem hiding this comment.
Thank you so much for this PR, and for your patience with the review!
revise README, add samples
Revise README.rst to use syntax sections recommended in
https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#sections
Improve README opening to better explain
ipromise.Add table of contents to README.
Revise README.rst line widths.
Add easier-to-read sample code, both in README and in python
files under
samples/.