-
Notifications
You must be signed in to change notification settings - Fork 4
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
Readme tools samples #9
Conversation
@NeilGirdhar any opinion on this PR? |
README.rst
Outdated
.. image:: https://badge.fury.io/py/ipromise.svg | ||
:target: https://badge.fury.io/py/ipromise | ||
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either say "this repository" or "I Promise". Just choose one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, this is good, but no need for the quotations around "promises".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
README.rst
Outdated
|
||
* implementing | ||
* overriding | ||
* augmenting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the commas and the "and". This is still a sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
README.rst
Outdated
* overriding | ||
* augmenting | ||
|
||
Using the ``ipromise`` inheritance patterns can ensure an inheritance hierarchy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed "build time".
tools/flake8.sh
Outdated
# | ||
# run flake8 with project settings | ||
|
||
set -eu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed scripts.
tools/mypy.sh
Outdated
|
||
set -eu | ||
|
||
cd "$(dirname -- "${0}")/.." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, i don't think this file helps. I just do
mypy ipromise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, I recommended two paths for mypy, ipromise
and test
. mypy passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then just do mypy ipromise tests
. You can add that to the readme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
tools/pytest.sh
Outdated
set -eu | ||
|
||
cd "$(dirname -- "${0}")/.." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, no need for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
tools/rst-lint.sh
Outdated
set -eu | ||
|
||
cd "$(dirname -- "${0}")/.." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good information. Would you mind putting this line:
rst-lint --level info README.rst
into 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is currently section Development which refers to these scripts. Is that adequate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sounds great. Would you mind adding this line to that section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there
README.rst
Outdated
|
||
.. code-block:: shell | ||
|
||
pip install restructuredtext_lint Pygments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This install should be in pyproject. If it isn't working for you, there's something wrong with your poetry setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
python -m pip install ipromise | ||
|
||
*** | ||
Use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks.
return super().f(**kwargs) | ||
|
||
MyClassAgumentedOnce().f() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay that makes sense.
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/
.