-
Notifications
You must be signed in to change notification settings - Fork 18
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
Neaten up README.md a little #235
Conversation
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.
Looks great! Thank for you this.
Left just minor queries.
.github/workflows/test.yml
Outdated
@@ -31,7 +31,7 @@ jobs: | |||
- 5432:5432 | |||
strategy: | |||
matrix: | |||
python-version: [3.7, 3.8, 3.9, '3.10', '3.11'] | |||
python-version: [3.8, 3.9, '3.10', 3.11, 3.12] |
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.
nit: '3.10' instead of 3.10?
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.
The quotes are required for 3.10 because without them YAML evaluates it as a float with the value 3.1. The others are fine.
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.
oh wow, can we keep all as strings then?
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.
README.md
Outdated
|
||
```shell | ||
$ python --version | ||
$ python3 --version | ||
``` | ||
If python is installed, all of its available versions would be listed. | ||
If Python is installed, its version will be listed. |
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.
nit:
version will be listed shown
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.
README.md
Outdated
|
||
If python isn't installed, Install Python 3.8 from [this link](https://www.python.org/downloads/). | ||
If Python isn't installed, [download and install](https://www.python.org/downloads/) the latest release. |
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.
should we say install any version from 3.8 to 3.12?
If the latest version is above 3.12, It could lead to unexpected errors?
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.
README.md
Outdated
|
||
More about virtualenvs on https://docs.python.org/3/tutorial/venv.html | ||
|
||
Setup a virtual environment using: | ||
|
||
```shell | ||
$ python3.8 -m venv .commcare-export-venv # update python version for the one installed | ||
$ python3 -m venv .venv |
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.
Any reason to change that back to venv?
I had made that change earlier to make the name more specific and avoid conflicts with any other setup since that is the name suggested by virtualenv documentation by default. We use the same name for CommCareHQ, venv
.
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.
Personally, I like "venv". (Some people seem to like to hide the directory.) I'll change it.
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 am happy with venv if you wish to keep that.
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.
export HQ_API_KEY=<apikey> | ||
```shell | ||
$ export HQ_USERNAME=<username> | ||
$ export HQ_API_KEY=<apikey> |
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.
nit:
Should not we generally avoid "$"?
Whenever I need to simply copy the command and run it, I need to remove that $ sign each time after pasting that into terminal.
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 added them in here to be consistent with the rest of the document (although I've just noticed I missed two others).
Generally, I have found it useful to indicate the prompt to make it clear what kind of prompt it is. e.g.
$ psql -U commcarehq
=# \l
List of databases
...
=# \q
$ python3
>>> print('Hello world.')
Hello world.
I have found that often writers will leave out the prompt so consensus is not universal, but that more often than not, they include it. Certainly across Dimagi docs, we seem to include it most of the time.
README.md
Outdated
|
||
results = query.eval(BuiltInEnv() | CommCareHqEnv(api_client) | JsonPathEnv()) | ||
|
||
if len(list(env.emitted_tables())) > 0: | ||
# with writers.Excel2007TableWriter("excel-output.xlsx") as writer: | ||
with writers.StreamingMarkdownTableWriter(sys.stdout) as writer: | ||
# with Excel2007TableWriter("excel-output.xlsx") as writer: |
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.
nit: could also remove that comment I believe.
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.
README.md
Outdated
| `+, -, *, //, /, >, <, >=, <=` | Standard Math | | | ||
| Function | Description | Example Usage | | ||
|--------------------------------|------------------------------------------------------------------------------|----------------------------------| | ||
| `+, -, *, //, /, >, <, >=, <=` | Standard Math | | |
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.
nit: Looks like this needs some more alignment correction.
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.
README.md
Outdated
@@ -71,6 +71,7 @@ $ venv | |||
Install CommCare Export via `pip` | |||
|
|||
```shell | |||
$ pip install setuptools |
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.
nit: Should we make a comment that this is for version 3.12?
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 just tested this in Python 3.12. Turns out we don't need setuptools if we install using pip install commcare-export
. I'll drop this line.
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.
@@ -42,23 +43,23 @@ More about virtualenvs on https://docs.python.org/3/tutorial/venv.html | |||
Setup a virtual environment using: | |||
|
|||
```shell | |||
$ python3 -m venv .venv | |||
$ python3 -m venv venv |
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.
oh, we are not keeping the folder hidden anymore.
Non blocking but for someone who does not understand these things well, they would get really confused of two "venv"s, about which one is command and which one is a folder.
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.
Oh! I completely misunderstood your comment,
Any reason to change that back to venv?
I had made that change earlier to make the name more specific and avoid conflicts with any other setup since that is the name suggested by virtualenv documentation by default. We use the same name for CommCareHQ,venv
.
I thought you were asking me to change .venv
to venv
in order to be consistent with its name in CommCare HQ. Sorry for my confusion.
avoid conflicts
virtualenvwrapper puts all your virtual environments in one place, so it's important to give them unique names. But the Standard Library's venv is simpler, and doesn't have a special place for all your virtual environments. In my experience, most people just use a subdirectory in the repository's root named "venv", so there is no risk of conflicts. This convention is used in GitHub's template .gitignore
file for Python projects. I've just applied the same convention here.
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.
Addresses a few nits:
This is a documentation only change.