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

Update the python setup instructions #442

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,18 @@ console.log(ARC) // [class ARC]

## Setup - Python

1. Install [python >3.11.x](https://www.python.org/downloads/)
2. Create folder and put an `requirements.txt` file inside.
3. Write `arctrl` and `fsspreadsheet` in two separate lines into it
```
arctrl
fsspreadsheet
```
4. run `py -m pip install -r requirements.txt`

Of course you can replace the command `py` with anything that leads to the python executable of your liking.
1. Install [python >=3.12](https://www.python.org/downloads/)
2. Run `pip install arctrl`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the reference to fsspreadsheet work?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, later I had to do pip install fsspreadsheet because python complained about not finding such a module. But I think it should in fact be possible to stick with a "one-step installation". Pip should be able to handle requirements without the user having to deal with it manually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the problem here is, that theres not actually a dependency to fsspreadsheet (the python package). So pip can't know this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could a solution be to add "fsspreadsheet" to pyprojec.toml (in the root folder of this project) -> [build-system] -> requires ?


Thats it! 🎉

You can now reference ARCtrl in any `.py` file and run it with `py path/to/Any.py`.
You can now reference ARCtrl in any `.py` file and run it with `python path/to/Any.py`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can vary by environment, which would be the more common one?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, I never saw a simple py before. If anything, sometimes python3 is/must be used, in my experience.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, okay doesn't really matter to me. The developer will hopefully pick the right one for himself.


Verify correct setup by creating `ARCTest.py` file with the content from below in the same folder, which contains your `requirements.txt`. Then run `py ./ArcTest.py`. This will print `<class 'arctrl.arc.ARC'>` into the console.
Verify a correct setup by creating a file `ARCTest.py` (anywhere). Then run `python path/to/ArcTest.py`. This will print `<class 'arctrl.arc.ARC'>` into the console.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with the "anywhere" and "python path/to" part. But the first sentence feels a bit off now grammatically. How about "Verify correct setup by creating ARCTest.py file (anywhere).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idc tbh :-) The sentence was in bullet point form anyway. Feel free to edit the style as you see fit. Your suggestion is fine by me.


```python
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make a difference in your markdown editor?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No but it is shorter. And for this markup purpose I promote the short versions. They are also less ambiguous regarding the spelling. I (and not only I) argue that for both humans and machines language tags like the following are actually easier and better for compatibility: py for Python, js for JavaScript, sh for shell/bash, etc.

```py
# ARCTest.py
from arctrl.arctrl import ARC;
from arctrl.arctrl import ARC

print(ARC) # <class 'arctrl.arc.ARC'>
```
Loading