-
Notifications
You must be signed in to change notification settings - Fork 55
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
🐞 Bug Bash wk 2🐞 Add: second lesson and images #120
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.
added my notes! I went through and provided comments as I went, rather than reading through a couple times and then giving feedback. so some of my comments are answered later in the tutorial, but I left the comments at the place in the tutorial where the question arose for me, and where it would be helpful to have some signposting.
tutorials/1-installable-code.md
Outdated
|
||
### Step 1: Set Up the Package Directory Structure | ||
|
||
Create a new directory for your package. Choose a name for your package, preferably in lowercase and without spaces (e.g., "pyospackage_yourname"). |
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 know this seems basic, but beginners don't always know that a folder and directory are the same thing. it might be worth clarifying the first time directory is used, and then repeating throughout the tutorial.
tutorials/1-installable-code.md
Outdated
|
||
Inside the package directory, | ||
|
||
- Create a `src/` directory |
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.
it would be beneficial to provide a quick Create a src/
directory by... and giving a 1-2 sentence bit of instruction on 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.
You probably want this to be a src
directory and drop the slash.
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.
ok got it.
can you please test this in shell for me? it works in my zsh shell so far
# Create a project directory in shell and a src directory within
mkdir -R pyospackage/src/pyospackage
# Change directory into pyospackage project dir
cd pyospackage
# View the current file structure
ls
# Create a pyproject.toml file in your project directory
touch pyproject.toml
# Create an empty init file within your src/pyospackage directory
touch src/pyospackage/__init__.py
Your final project directory structure should look like this:
pyospackage/ # This is your project directory
└─ pyproject.toml
└─ src/ # This is your package directory where your code lives
└── pyospackage_yourname/
├── __init__.py
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've never used a mkdir
with a -R
option. I think you might have meant mkdir -p
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.
🙈 and i think i just made up a flag didn't i? thank you for the catch!! you are right. i am not sure where i got R from TBH. recursive? 🤷♀️
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.
Overall, this is taking shape nicely.
tutorials/1-installable-code.md
Outdated
have is to make that code pip installable. You will learn how to make | ||
your code pip installable in this lesson. | ||
|
||
<!-- |
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.
Let's remove the comment and create a checklist of questions in a github issue.
tutorials/1-installable-code.md
Outdated
|
||
* [If you need guidance creating a Python environment, review this lesson](extras/1-create-environment.md) which walks you through creating an environment using both `venv` and `conda`. | ||
* If you aren't sure which environment manager to use and | ||
you are a scientist, we suggest that you use `conda`. |
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.
you are a scientist, we suggest that you use `conda`. | |
you are a scientist, we suggest that you begin with `conda` because conda offers flexibility to extend to other programming languages, such as C, C++. |
tutorials/1-installable-code.md
Outdated
|
||
Inside the package directory, | ||
|
||
- Create a `src/` directory |
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.
You probably want this to be a src
directory and drop the slash.
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 a really great tutorial!
tutorials/1-installable-code.md
Outdated
# Make your Python code pip installable | ||
|
||
The first step in creating a Python package based on code that you | ||
have is to make that code pip installable. You will learn how to make |
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.
Not sure that we need to have "pip installable" everywhere. True, it's the most common installer, and I'm good if we sometimes say pip-installable, or use pip for real examples. But "install(able)" seems to convey as much relevant information and won't cause confusion if/when we introduce other tools (like conda).
(edit) after going through the whole file I see it's not all pip-install and this point has already been raised. But I still find it odd that the h1 heading mentions pip.
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.
ok i have a question @ucodery is there a way to install this type of package with conda? it never occurred to me that one could conda install a package locally if it wasn't a "conda packaged package" if that makes sense.
i'm fine with backing off the language pip. as i suppose you could do a hatch install or pdm install or poetry install too!
but your comment made me wonder about the range of tools that could actually install a package beyond pip and whether conda was actually in the mix.
for now i'll leave this comment open and will reread the lesson with that lense given at a minimum hatch, poetry and pdm (and flit??) could all potentially install this package we are teaching them to create 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.
I don't use conda, so I don't know if it can do a local install. As for the other packaging tools, those that are package managers can install as you noted (so not flit). There is also the low-level installer
tool as well as older, deprecated installers such as easy_install
.
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.
got it - thank you!
The reason why i've been careful about pip vs conda here is that a lot of scientists use conda (me included). And installing a conda version of python is so so easy - you can easily then create envts using various python versions with a single command, and it's friendlier if you are using tools that process spatial data.
so many will come from a conda background and need to understand how pip vs conda works. if we rely ONLY on python.org python and pip some scientists will have to relearn envt management. and it will get confusing i think.
either way i think this will be a bit of a thorn that we need to polish down in our lessons - which is why i thought about suggesting conda but having instructions for a non conda envt manager as well such as venv given it's native to python installs. then we can have a lesson (i have one started already) on venv vs conda installs.
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.
leaving this open for now. as it might warrant more discussion in slack / here to get it right!
dc416d7
to
a51c1c2
Compare
7770cb3
to
492ddfe
Compare
Co-authored-by: Jesse Mostipak <[email protected]>
Co-authored-by: Jesse Mostipak <[email protected]>
Co-authored-by: Carol Willing <[email protected]>
Co-authored-by: Carol Willing <[email protected]>
Co-authored-by: Jeremy Paige <[email protected]>
Co-authored-by: Jeremy Paige <[email protected]>
Co-authored-by: Jeremy Paige <[email protected]>
Co-authored-by: Jeremy Paige <[email protected]>
Co-authored-by: Jeremy Paige <[email protected]>
Co-authored-by: Jeremy Paige <[email protected]>
7473f6b
to
af6c0ac
Compare
closing this via #120 |
This is the second PR associated with the tutorial lesson development. it is ready for review. in this lesson a beginners learns how to make code pip installable. 🐞