-
Notifications
You must be signed in to change notification settings - Fork 22
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 fix #8
Readme fix #8
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.
tl;dr: LGTM (looks good to me) 👍
the longer version: Thanks for those changes. I have to admit that I hadn't thought much about the correct specification of Python versions so far, largely because many distributions/package manager make sure that python
points to your preferred python version. But it turns out there is a PEP for this and the changes proposed here adhere to PEP 394 as is now!?
@madprime you're the better Python programmer, do you agree with my interpretation?
This looks great, and I'm not sure I'm a better Python programmer! I've only just learned that So... I think the README fix should instead change this whole project to use (Sorry for the extra work! But I think this is ideal...) This probably includes the following changes...
This would make specifying python3 vs python redundant but harmless (it's fine to keep it). There may be other additions needed for instructions that become obvious as one goes through setup with a |
.gitignore
Outdated
my_project | ||
|
||
#Pipfile | ||
Pipfile |
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.
per my comment, rather than this being ignored, I think requirements.txt should be replaced with Pipfile
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.
So should I just update the file name of requirements.txt
as Pipfile
?
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.
No, you should keep the Pipfile
as created by pipenv --three install -r requirements.txt
and commit to the repository too, along with Pipfile.lock
(and remove both from the .gitignore
)
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.
However the requirements.txt
contains one additional dependency other than those in the generated Pipfile
named six==1.11.0
. How to tackle this? @madprime
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.
Can you have a look into your Pipfile.lock
? six
should turn up there 😃
.gitignore
Outdated
@@ -30,3 +31,9 @@ db.sqlite3 | |||
|
|||
# dotenv (environment variables, used for secret/local stuff) | |||
.env | |||
|
|||
#Name of the virtual environment | |||
my_project |
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 believe pipenv automatically creates a virtual environment elsewhere (by default, in a user's .local directory) – let's switch to that, and then I think this becomes unneeded.
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.
Yeah it created a virtual environment like this in my case on running pipenv install requests
:
Virtualenv location: /home/kriti/.local/share/virtualenvs/oh-proj-management-Yei1TVXn
I think Pipfile was also created by the same command.
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.
Great! Sounds like you can remove this from the .gitignore, then. (If you make a new commit to this branch, your PR automatically updates.)
Yeah, I didn't know that before either :D
Yes, that sounds good to me. I personally don't have a strong preference for any of these solutions and I guess in the end they all do the same thing if one uses them to create virtual environments.
Nope, the Committing these |
I think Pipfile specifies versions… and it seems |
In our current case that's true as we specify exact versions in our Indeed, the |
Also see http://pipenv.readthedocs.io/en/latest/advanced/#specifying-basically-anything how you can specify minimal & maximal version numbers in a Pipfile: http://pipenv.readthedocs.io/en/latest/advanced/#specifying-basically-anything |
Ah, ok, yes, keep it out of gitignore then. From those docs, this is relevant to webapp dev and deploy: You can use pipenv lock to compile your dependencies on your development environment and deploy the compiled Pipfile.lock to all of your production environments for reproducible builds. |
Yep, the alternative would be to always specify the exact versions in 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.
I think this looks good now, the only comment would be that I think we prefer having a Pipfile.lock. While I've merged @rosygupta's PR instead, please do reference this as a contribution, that work was certainly inspired by this! :)
Thanks so much for this! PR #9 ended up being merged instead. |
I have tried to come up with the solutions of the problems I faced while setting up the project.
python3 manage.py migrate
frompython manage.py migrate
andpython3 manage.py runserver
frompython manage.py runserver
as we are using python3 so the initial command is likely to use a lower version of python.