linkedin / linkedin/shiv

zope.event is not packaged properly when installed together with zope.interface

Open
#187 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.9k
Forks
114
PR merge metrics
No merged PRs in 30d

Description

When I package a python package which has a dependency on both `zope.event` and `zope.interface`, `zope.event` is not importable. Example case:

```
[15:05:06] λ shiv -o ~/bin/zope_event zope.event zope.interface --upgrade
Collecting zope.event
Using cached zope.event-4.5.0-py2.py3-none-any.whl (6.8 kB)
Collecting zope.interface
Using cached zope.interface-5.4.0-cp39-cp39-manylinux2010_x86_64.whl (255 kB)
Collecting setuptools
Using cached setuptools-57.4.0-py3-none-any.whl (819 kB)
Installing collected packages: setuptools, zope.interface, zope.event
Successfully installed setuptools-57.4.0 zope.event-4.5.0 zope.interface-5.4.0

[15:05:18] λ echo "import zope.event" | SHIV_INTERPRETER=1 python -S ~/bin/zope_event
Python 3.9.6 (default, Jul 16 2021, 00:00:00)
[GCC 11.1.1 20210531 (Red Hat 11.1.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'zope.event'
>>>
now exiting InteractiveConsole...
```

(my original case is packaging https://github.com/Fizzadar/pyinfra/ with `shiv -c pyinfra -o ~/bin/pyinfra pyinfra`, which has this dependency)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documented shiv command with zope.event and zope.interface, then run the shown `import zope.event` check under Python 3.9. Investigate how shiv packages these dependencies together; done means the generated executable can import zope.event successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.