Open WeisLeDocto opened 9 months ago
It should first be checked if it is allowed to have the same packages in the dependencies and optional-dependencies fields. Double-checking the validity of this system with a question on the Python Discourse would be safer. It would, at that point, also be good to check with the maintainers of DeepCell if they have any opinion on this solution.
In the light of this topic on the Python Discourse, it appears that having the version of DeepCell
depend on an optional-dependencies
would prove very hard, if not impossible. A more realistic approach will be to simply require users to provide a token when installing MyoFInDer, and raise an exception if no token is provided.
The new strategy is as follows:
12.0.7
becomes too old, critical performance improvement in newer version of DeepCell, end of support for the token-free DeepCell repository, etc.) the new branch is merged and using a DeepCell token becomes mandatory to use MyoFInDerThe implementation would be the following:
The changes in #44 now make it possible to request a token during installation with the Windows installer.
if the provided one is not valid, an error message is displayed in a popup window, and the user is invited to re-enter a valid token
UPDATE: Won't be feasible as there is no way to preemptively check if a token is valid without actually downloading something. The error displayed in the terminal should be clear enough for users to know what's wrong, and should clearly provide the path to the file to modify.
Starting from release
0.12.8
, thedeepcell
library requires a token authentication for users to be able to download the weights of the AI models. Currently, we circumvent this limitation by enforcing the use of version0.12.7
, that allows to freely download the weights of the AI model.On the long term, the possibility to provide a token and to install a newer version of DeepCell will however become necessary, as version
0.12.7
will age and eventually not be compatible with the evolution of Python. There are several requirements for integration in the basic interface of MyoFInDer:0.12.7
to a more recent one might entail re-installing a number of dependencies. We need to make sure that a token was given, and that it is valid, before triggering the upgrade.The default behavior should be to stick to version
0.12.7
, maybe with regular messages advising users to request a token. For command-line users, it seems reasonable to request a manual update of DeepCell once they have provided their token. For regular Windows users, the bash script managing startup should be responsible for checking if a token was provided, and if it is valid. Once provided, the token could be stored in a__token__
file in the base folder of MyoFInDer.The practical implementation of the token system is not straightforward to achieve in a clean way. Making use of the
optional-dependencies
ofpyproject.toml
could be an option, and work as follows:deepcell
, and therefore installs the latest availablemyofinder[no-token]
, that specifiesdeepcell==0.12.7
as a requirementmyofinder[token]
is installed and specifiesdeepcell>0.12.7
as a requirement, thus installing the latest versionIt should first be checked if it is allowed to have the same packages in the
dependencies
andoptional-dependencies
fields. Double-checking the validity of this system with a question on the Python Discourse would be safer. It would, at that point, also be good to check with the maintainers of DeepCell if they have any opinion on this solution.