-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Using pysqlite3-binary fails on install --deploy
when locked on M1 and installed on Linux
#5723
Comments
I think the problem here is that I'm developing on an M1 Mac but deploying on a Linux container. Since the Mac ignores the I have worked around this by locking within Docker like so: -COPY Pipfile* ./
+COPY Pipfile ./
-RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy --verbose
+RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --verbose However, this goes against the pipenv recommendtion to avoid modifying the lockfile during CI. So I would prefer another solution. I also tried this approach of locking in the CI using RUN PIPENV_VENV_IN_PROJECT=1 pipenv lock --keep-outdated
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy --verbose But I got the same failure as before for some reason. Lastly, I tried using packages categories to restrict the locking to just the sqlite package, like so: [packages]
requests = "*"
boto3 = "*"
jinja2 = "*"
pytz = "*"
[sqlite]
pysqlite3-binary = { version = "*", platform_machine = "== 'x86_64'" }
[dev-packages]
isort = "*"
black = "*"
flake8 = "*" I then lock just that category in the Dockerfile: COPY Pipfile* ./
RUN PIPENV_VENV_IN_PROJECT=1 pipenv lock --categories sqlite
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy --categories="packages sqlite" --verbose This works, and seems like the least bad option. But please let me know if I'm missing something. |
Yeah, this is probably your least bad option for now. The fundamental problem of building an sdist and getting the hashes for a different system than the one you are locking on is a well known problem. |
install --deploy
when locked on M1 and installed on Linux
Alright, thanks for confirming. Would be great to get a cleaner solution, but I'll use the multiple categories for now. |
Issue description
I have a Pipfile which has two requirements in it,
pysqlite3-binary
andpytz
. Either requirement installs successfully on its own, but pipenv fails when asked to install them together. In testing, I've discovered that it appears that ANY package paired withpysqlite3-binary
will cause the install to fail.Expected result
I expected the install to work. This same setup worked last year, but when I tried to do it again, it failed this time.
Actual result
Build log
Steps to replicate
Provide the steps to replicate (which usually at least includes the commands and the Pipfile).
Take this Dockerfile:
And this Pipfile:
And then attempt to build the Dockerfile:
NB: the
pysqlite3-binary
package only has Linux wheels, hence the platform specifics. Also, I have tried bothversion = "*"
and pinning the version to0.5.0
, but get the same failure each time.I'm on an M1 Mac, although this same error is happening on GitHub Actions when it tries to build the container there.
$ pipenv --support
Pipenv version:
'2023.6.2'
Pipenv location:
'/var/lang/lib/python3.10/site-packages/pipenv'
Python location:
'/var/lang/bin/python3.10'
OS Name:
'posix'
User pip version:
'23.1.2'
user Python installations found:
PEP 508 Information:
System environment variables:
_
HOME
SHLVL
PYTHONDONTWRITEBYTECODE
TZ
LAMBDA_RUNTIME_DIR
LANG
PYTHONFAULTHANDLER
PWD
PATH
LAMBDA_TASK_ROOT
LD_LIBRARY_PATH
LC_ALL
PIP_DISABLE_PIP_VERSION_CHECK
PIP_PYTHON_PATH
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin
LANG
:C.UTF-8
PWD
:/var/task
Contents of
Pipfile
('/var/task/Pipfile'):Contents of
Pipfile.lock
('/var/task/Pipfile.lock'):The text was updated successfully, but these errors were encountered: