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

Consider renaming bin/manage.py and bin/py.test #992

Open
toolness opened this issue Feb 3, 2018 · 0 comments
Open

Consider renaming bin/manage.py and bin/py.test #992

toolness opened this issue Feb 3, 2018 · 0 comments

Comments

@toolness
Copy link
Contributor

toolness commented Feb 3, 2018

Most commands in the bin directory, added in #990, will work on Windows if we create .bat variants. For example if we create a bin/flake8.bat that does the same thing in Windows-land as bin/flake8, then someone in Windows-land can type bin\flake8 to start flake8.

However, when a file with an extension is called as a command in Windows' standard command interpreter, cmd.exe, doesn't search for anything with a .bat extension; instead, it opens the file using the application associated with that extension. This means, for instance, that typing bin\manage.py will either try opening that file with the user's Python interpreter (if they have Python installed), or open an annoying dialog asking what they want the user to do with manage.py (if the user doesn't have Python installed). Either way, the wrong thing happens on Windows.

One solution is to make Windows users always add .bat to the end of the command, but this extra work is cumbersome, and forgetting to add it results in something very confusing happening. So instead, I think it might be better to simply rename such commands to not have extensions:

  • bin/py.test can be renamed to bin/pytest. This is actually something py.test does anyways (it makes its main script available at both py.test and pytest) so I think it should still be in keeping with convention.
  • bin/manage.py is a bit more challenging, since there aren't other conventional names for that script. I think bin/manage or bin/managepy could work OK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant