Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update fetch_dependencies #194

Merged
merged 5 commits into from
May 28, 2023
Merged

Conversation

aplaice
Copy link
Collaborator

@aplaice aplaice commented May 18, 2023

We need to replace --binary :all: with --binary $(pipenv requirements | sed -n 's/==.*//p' | tr '\n' ',') because otherwise pip tries to build everything from scratch (including the build system (??)).

We need the new dulwich options:

--config-settings "--global-option=--pure"

because pip has changed the application of build options, so building pure python packages becomes harder. See dulwich issue 1093.


Update Pipfile.lock

Remove packages dataclasses and typing which are both built-in for python3.7.

Pipfile.lock is regenerated from scratch, updating everything!


Force protobuf python implementation

It seems that Anki 2.1.35 (the last version compatible with python3.7) is not actually compatible with the latest protobuf (possibly released after Anki 2.1.35).

See:
https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

Both anki and protobuf are dev dependencies so this incompatibility only affects testing.

We will be able to remove this workaround by upgrading to python3.9 (compatible with latest Anki). (See: #183.)


Avoid pipenv process substitution in fetch_dependencies.sh

I don't fully understand why, but pipenv run foo <(bar) process
substitution doesn't work in GitHub actions.

AFAICT in a "normal" environment, pipenv execs into its subcommand process (here foo), and the subcommand inherits all its file descriptors (including the file descriptor for <(bar), inherited from fetch_dependencies.sh.

In GitHub actions, for unknown, to me, reasons, pipenv instead creates a separate child process for foo and does not share its file descriptors, so foo doesn't have access to <(bar).

@aplaice aplaice force-pushed the fix_fetch_dependencies branch from 432a67d to 2634e1f Compare May 18, 2023 14:20
aplaice added 3 commits May 22, 2023 00:32
Remove packages dataclasses and typing which are both built-in for
python3.7.

Pipfile.lock is regenerated from scratch, updating everything!
We need to replace --binary :all: with --binary $(pipenv requirements
| sed -n 's/==.*//p' | tr '\n' ',') because otherwise pip tries to
build everything from scratch (including the build system (??)).

We need the new dulwich options:

--config-settings "--global-option=--pure"

because pip has changed the application of build options, so building
pure python packages becomes harder.  See dulwich issue 1093.
It seems that Anki 2.1.35 (the last version compatible with python3.7)
is not actually compatible with the latest protobuf (possibly released
after Anki 2.1.35).

See:
https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

Both anki and protobuf are dev dependencies so this incompatibility
only affects testing.

We will be able to remove this workaround by upgrading to
python3.9 (compatible with latest Anki).
@aplaice aplaice force-pushed the fix_fetch_dependencies branch from 2634e1f to 9e5fd2f Compare May 21, 2023 22:34
aplaice added 2 commits May 23, 2023 12:45
I don't fully understand why, but `pipenv run foo <(bar)` process
substitution doesn't work in GitHub actions.

AFAICT in a "normal" environment, pipenv execs into its subcommand
process (here `foo`), and the subcommand inherits all its file
descriptors (including the file descriptor for `<(bar)`, inherited
from `fetch_dependencies.sh`.

In GitHub actions, for unknown, to me, reasons, pipenv instead creates
a separate child process for `foo` and does not share its file
descriptors, so `foo` doesn't have access to `<(bar)`.
pyyaml detects the presence of the libyaml library, and builds with
the libyaml extension if it's present.  In principle, there's a
--without-libyaml flag, to ensure building without libyaml even if the
library is present, but it doesn't work.  (Also, there is an issue
with passing on `--without-libyaml` via pip to setup.py.)
PYYAML_FORCE_LIBYAML=0 is not documented, but works.

Another workaround would be to ensure that libyaml is not present, but
that's brittle, since then the build system starts depending on global
configuration (presence/absence) of system libraries.
@aplaice aplaice merged commit aca6933 into Stvad:master May 28, 2023
@aplaice aplaice deleted the fix_fetch_dependencies branch May 28, 2023 09:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant