Stvad / CrowdAnki

Plugin for Anki SRS designed to facilitate cooperation on creation of notes and decks.
MIT License
520 stars 44 forks source link

Update fetch_dependencies #194

Closed aplaice closed 1 year ago

aplaice commented 1 year ago

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).