Skip to content

Add a batch file #1348

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

Merged
merged 1 commit into from
Apr 8, 2016
Merged

Add a batch file #1348

merged 1 commit into from
Apr 8, 2016

Conversation

refi64
Copy link
Contributor

@refi64 refi64 commented Apr 8, 2016

Closes #1226. @johnthegen Can you try this out?

@refi64
Copy link
Contributor Author

refi64 commented Apr 8, 2016

Whoops, meant @johnthagen.

@gvanrossum
Copy link
Member

I'll hold off until someone confirms it works.

Some questions in the mean time:

  • Does it require that Python 3 is installed as "python" ?
  • IIRC there's a default binding of *.py files to be executed by the (most recently installed?) Python interpreter. Maybe installing scripts/mypy as scripts/mypy.py would be an alternative?
  • Don't newer Python versions for Windows have some kind of "py" program that launches Python scripts?

@refi64
Copy link
Contributor Author

refi64 commented Apr 8, 2016

@gvanrossum

1: Doesn't the Python 3 installer always install it as <install_directory>/python.exe?
2 and 3: That will invoke hell if you have two Python versions installed. Using scripts/mypy.py will use the default Python interpreter instead of the one mypy was installed in. For instance, if I have Python 3.4 and 3.5 installed, and 3.5 is my default, but I install mypy into 3.4, then running scripts/mypy.py would run it under Python 3.5 instead. I believe the py scripts would result with the same thing.

@gvanrossum
Copy link
Member

As I said, I haven't followed the development of the Windows installer at all. So someone who can actually play with it on Windows will have to answer. Remaining question: how does your script end up invoking the correct Python binary?

@refi64
Copy link
Contributor Author

refi64 commented Apr 8, 2016

@gvanrossum %dp0 will get the location of the Python directory in which the script was installed.

@gvanrossum
Copy link
Member

gvanrossum commented Apr 8, 2016 via email

@johnthagen
Copy link
Contributor

@kirbyfan64 Seems to have worked, thanks!

C:\Users\John Hagen>pip install git+https://github.com/kirbyfan64/mypy@bat_file
Collecting git+https://github.com/kirbyfan64/mypy@bat_file
  Cloning https://github.com/kirbyfan64/mypy (to bat_file) to c:\users\johnha~1\appdata\local\temp\pip-6v6s7ej5-build
Installing collected packages: mypy-lang
  Running setup.py install for mypy-lang ... done
Successfully installed mypy-lang-0.3.1

C:\Users\John Hagen>mypy
usage: mypy [-h] [-v] [-V] [--python-version x.y] [--py2] [-s]
            [--disallow-untyped-calls] [--disallow-untyped-defs]
            [--check-untyped-defs] [--fast-parser] [-f] [--pdb]
            [--use-python-path] [--stats] [--inferstats]
            [--custom-typing MODULE] [--html-report DIR]
            [--old-html-report DIR] [--xslt-html-report DIR]
            [--xml-report DIR] [--txt-report DIR] [--xslt-txt-report DIR]
            [--linecount-report DIR] [-m MODULES] [-c COMMAND] [-p PACKAGE]
            [files [files ...]]
mypy: error: Missing target module, package, files, or command.

Tested on:

  • Windows 10 x64
  • Python 3.5.1
  • pip 8.1.1

@gvanrossum gvanrossum merged commit 748c4bb into python:master Apr 8, 2016
@gvanrossum
Copy link
Member

Thanks! Merged now.

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

Successfully merging this pull request may close these issues.

3 participants