Editable install stops working with setuptools 64 and above #3542
Replies: 3 comments 5 replies
-
Hello @ianjosephwilson, could you describe a little bit more in detail how you are reproducing this error? I tried the following, but everything runs smoothly, I don't seem to find any error: cd /tmp
git clone https://www.github.com/ianjosephwilson/shopauth
cd shopauth
virtualenv -p python3.10 .venv
.venv/bin/python -m pip install -U 'pip==22.1.2' # latest version
.venv/bin/python -m pip install -e .
mkdir _avoid_implicit_pythonpath # can be avoided if you are using src-layout
cd _avoid_implicit_pythonpath
../.venv/bin/python -c 'import shopauth; print(dir(shopauth))' As a response, I am getting the following: ['AssociatedUser', 'DAY_IN_SECONDS', 'DEFAULT_SESSION_TYPE_LOOKUP', 'IAppInstalledHandler', 'INSTALL_SESSION_TYPE', 'ISessionSerializer', 'IStorageShim', 'IWebShim', 'InstallSession', 'MINUTE_IN_SECONDS', 'OAUTH_SESSION_TYPE', 'OAuthSession', 'OFFLINE_ACCESS_MODE', 'ONLINE_ACCESS_MODE', 'OfflineSession', 'OnlineAccessInfo', 'OnlineSession', 'ShopAuthConfig', 'ShopAuthService', 'ShopSessionSerializer', 'ShopifyJWTPayload', 'ZERO_SECONDS', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'asdict', 'b64decode', 'build_shop_host', 'dataclass', 'datetime', 'extract_shop_name', 'field', 'hashlib', 'hmac', 'interfaces', 'json', 'jwt', 'logger', 'logging', 'random', 're', 'requests', 'scopes', 'scopes_have_changed', 'string', 'time', 'timedelta', 'timezone', 'urlencode', 'util', 'uuid', 'zope'] |
Beta Was this translation helpful? Give feedback.
-
It is a bit more complicated but I wasn't sure if it was necessary to explain everything. I have a Dockerfile that that builds an image of my application and installs a wheel of shopauth, that is the typical production setup. During development I set an environmental variable that is checked in my In the examples below the Snippet from the if env.EDITABLE_SHOPAUTH:
# But also try installing it.
print("Linking shopauth with pip -e.")
check_call(["pip", "install", "-e", "/app/shopauth"]) Snippet from the docker-compose file that maps the host dir to the docker container dir: #....
environment:
#...
- EDITABLE_SHOPAUTH=1
volumes:
# ....
- ../shopauth:/app/shopauth Using Some versions: The setuptools version is whatever is pulled in based on if I pinned or didn't pin it in the Thanks. |
Beta Was this translation helpful? Give feedback.
-
I think I figured it out actually. It seems that the directory with setup.py is being picked up as an My failing source mapping looks like this:
Keeping the source isolated like this works, ie. don't make shopauth a subdirectory of main package:
|
Beta Was this translation helpful? Give feedback.
-
Took me a while to figure out what happened because it seemed I didn't change anything. I have a simple pyproject.toml file:
I also have a
setup.py
file:I use
pip -e shopauth
to install an editable package I wrote alongside my main apppackage during development (also an editable install but no pyproject.toml file). In setuptools 64 the new pep660 implementation I guess went into affect and broke this setup. The helper package imports but doesn't have anything in it. If you dir it there is just the boilerplate attributes like__name__
,__path__
, etc.I'm reluctant to report this as a bug because I have no idea how this configuration should work. I realize now I should have setuptools pinned to a version to prevent this sort of suprise breakage in the future but want to know how to shoehorn my workflow to be compatible with the future of python packages.
Looking for some sort of direction. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions