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

Allow zipapp to target modules #70465

Open
flying-sheep mannequin opened this issue Feb 3, 2016 · 1 comment
Open

Allow zipapp to target modules #70465

flying-sheep mannequin opened this issue Feb 3, 2016 · 1 comment
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@flying-sheep
Copy link
Mannequin

flying-sheep mannequin commented Feb 3, 2016

BPO 26277
Nosy @pfmoore, @flying-sheep

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2016-02-03.12:25:04.392>
labels = ['extension-modules', 'type-feature']
title = 'Allow zipapp to target modules'
updated_at = <Date 2016-02-03.17:36:37.779>
user = 'https://github.com/flying-sheep'

bugs.python.org fields:

activity = <Date 2016-02-03.17:36:37.779>
actor = 'brett.cannon'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Extension Modules']
creation = <Date 2016-02-03.12:25:04.392>
creator = 'flying sheep'
dependencies = []
files = []
hgrepos = []
issue_num = 26277
keywords = []
message_count = 1.0
messages = ['259476']
nosy_count = 2.0
nosy_names = ['paul.moore', 'flying sheep']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue26277'
versions = ['Python 3.6']

@flying-sheep
Copy link
Mannequin Author

flying-sheep mannequin commented Feb 3, 2016

currently, zipapp’s notion of __main__.py is very different from the usual.

the root directory of a zipapp is not a module, therefore __init__.py isn’t used and relative imports from __main__.py don’t work.

i propose that the zipapp functionality is amended/changed to

  1. allow more than one target directory (bundle multiple modules)
  2. allow creation of a __main__.py that contains a runpy-powered module runner

so maybe we could specify the module itself as entry point to get this behavior

zipapp -m my_module dependency.py my_module

should create

my_module.pyz
├ __main__.py → ...runpy.run_module('my_module')
├ dependency.py
└ my_module
├ __init__.py
└ __main__.py → from . import ...

or there would be another option to specify it.

@flying-sheep flying-sheep mannequin added extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels Feb 3, 2016
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

0 participants