GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add zipapp support by asottile · Pull Request #1616 · pre-commit/pre-commit

Conversation

@asottile

@asottile asottile commented Sep 23, 2020

Copy link
Copy Markdown
Member

seems to work!

$ ./pre-commit-2.7.1.pyz run flake8 --all-files
flake8...................................................................Passed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@asottile asottile mentioned this pull request Sep 23, 2020
What's the best way to install pre-commit for a npm/javascript project #1439
Open
@asottile
asottile force-pushed the zipapp branch from fb47b26 to 0d81545 Compare September 23, 2020 23:08
@asottile

asottile commented Sep 23, 2020

Copy link
Copy Markdown
Member Author

doesn't quite work on windows yet -- I probably need the shebang code here as well:

C:\Users\Anthony\workspace\babi>python E:\VMs\Ubuntu20.04_shared\pre-commit-2.7.1.pyz run --all-files
[INFO] Initializing environment for https://gitlab.com/pycqa/flake8.
[INFO] Initializing environment for https://gitlab.com/pycqa/flake8:flake8-typing-imports==1.7.0.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-autopep8.
[INFO] Initializing environment for https://github.com/asottile/reorder_python_imports.
[INFO] Initializing environment for https://github.com/asottile/pyupgrade.
[INFO] Initializing environment for https://github.com/asottile/setup-cfg-fmt.
[INFO] Installing environment for https://gitlab.com/pycqa/flake8.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\Anthony\\.cache\\pre-commit-zipapp\\SuNk3yXatwvuqrztl46R2--u3qyqevT15p2e3M1XeSM\\fakepython', '-mvirtualenv', 'C:\\Users\\Anthony\\.cache\\pre-commit\\repo0di586bv\\py_env-python3.7', '-p', 'C:\\Users\\Anthony\\.cache\\pre-commit-zipapp\\SuNk3yXatwvuqrztl46R2--u3qyqevT15p2e3M1XeSM\\fakepython')
return code: 1
expected return code: 0
stdout:
    Executable `python3` not found
stderr: (none)
Check the log at C:\Users\Anthony\.cache\pre-commit\pre-commit.log
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asottile

asottile commented Sep 24, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

looks like this is going to need #1617 on windows :(

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asottile
asottile force-pushed the zipapp branch from 0d81545 to 379bc82 Compare September 24, 2020 02:08
@asottile

asottile commented Sep 24, 2020

Copy link
Copy Markdown
Member Author

windows needs more work as well, probably need to write a shim python.bat (I couldn't get python.py via python to work for whatever reason -- though it works from cmd.exe)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asottile
asottile force-pushed the zipapp branch 2 times, most recently from 0b40d1b to 4e18f65 Compare September 25, 2020 22:54
@asottile

asottile commented Sep 25, 2020

Copy link
Copy Markdown
Member Author

looks like a .bat isn't going to work either, so I should probably attempt to do this with a .exe :(

almost everything works, like out.pyz run --all-files works fine and dandy

but running from git commit does not work on windows:

C:\Users\Anthony\workspace\babi>git commit -m "foo"
Traceback (most recent call last):
  File ".git/hooks/pre-commit", line 42, in <module>
    raise SystemExit(subprocess.call(CMD))
  File "C:\Python37\lib\subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Python37\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Python37\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
OSError: [WinError 193] %1 is not a valid Win32 application

and I feel like that's kinda important :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

asottile added 2 commits September 28, 2020 16:57
@asottile
add zipapp support
bc198b8
@asottile
make an exe stub for windows
fbd5292
@asottile
asottile force-pushed the zipapp branch from 4e18f65 to fbd5292 Compare September 29, 2020 01:37
@asottile

asottile commented Sep 29, 2020

Copy link
Copy Markdown
Member Author

made a shim .exe and it seems to work!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asottile
asottile merged commit 9e4754f into master Oct 17, 2020
@asottile
asottile deleted the zipapp branch October 17, 2020 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@asottile
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.