Skip to content

Commit

Permalink
Fix Python 2 editable user install (#2224)
Browse files Browse the repository at this point in the history
This appears to be fixed in setuptools 62, but Python 2 is stuck at
version 44. Use a workaround which overrides the disabled user installs
temporarily.

This fixes our develop Dockerfile too!
  • Loading branch information
peace-maker committed Jul 10, 2023
1 parent 83e1921 commit b23251d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@

compat = {}
if sys.version_info < (3, 4):
import site

import toml
project = toml.load('pyproject.toml')['project']
compat['install_requires'] = project['dependencies']
compat['name'] = project['name']
if '--user' in sys.argv:
sys.argv.remove('--user')
# https://github.com/pypa/pip/issues/7953
site.ENABLE_USER_SITE = "--user" in sys.argv[1:]


# Check that the user has installed the Python development headers
Expand Down

0 comments on commit b23251d

Please sign in to comment.