Open benoit-cty opened 8 months ago
A way to fix this will be to stop using sub-path and files for parameters and use a unique file, like a database. But it will be more complicated to maintain.
An option is to keep separate files for development but package them in one for the package release.
Any ideas ?
Thank you for sharing this issue!
Is it linked to the CASD environment where we might not have enough rights to change the Windows OS default path lengths?
Some windows+openfisca users change this setting as described for example by this article (they also have to update the GIT configuration with
git config --system core.longpaths true
).
The described error is linked to the openfisca_france_reforms repository which contains some reforms to the openfisca-france
model. That's why an installation error coming from the parameters paths is in fact linked to the openfisca-france
repository.
Then, as the way we manage the parameters in the openfisca models also comes from openfisca-core
, this issue is opened on the openfisca-core
repository.
This issue also refers to the leximpact-prepare-data repository: it calls openfisca-france-reforms
to apply it on survey and CASD data. So, it does not affect the parameters paths but it comes with environment contraints as the code runs both on local machines and on the CASD environment.
@benoit-cty don't hesitate to edit this section if needed 😊
Thanks for the precisions! It's not only CASD but all Windows developpers that do not have full access to their corporate computer. That's the case at the French assembly for example.
Thanks for reporting this issue @benoit-cty.
Given that the use of sub-folders is not enforced by core but just an opinionated practice of country-package maintainers, do you see what could be fixed in core to help users facing this issue?
A way to fix this will be to stop using sub-path and files for parameters and use a unique file, like a database.
You can already do that.
An option is to keep separate files for development but package them in one for the package release.
All parameters are loaded in memory, so « compiling » all files into one and using that one parameter file should be more or less trivial. However, as with the previous idea, that is a script that can be perfectly implemented either within a country package, or as an utility function separately, without requiring any changes in core at all.
But it is not enought because Conda (or pip ?) use a temp path named C:\Users\bcourty\AppData\Local\Temp\pip-install-oboo5tz8\openfisca-france-reforms_9411943aa5784ca9bcc79d7d516ec176\
That might be actually related to core, but I'm not sure: variables (and I assume extensions are reforms) are loaded dynamically by core, with a unique id corresponding to the addess in memory of each variable.
However, I believe that happens after the file is read into memory, so I suspect that the problem you report happens before (and this mechanism by the way does not apply to parameters).
By the way, I don't know if it is related to this specifically https://github.com/conda/conda/issues/7203
@benoit-cty @sandcha An idea:
find openfisca_france/parameters -name "*.yaml" | xargs -I{} sh -c 'cat {}; echo ""' >> parameters.yaml
(However, there is a possible issue concerning core here: namespacing, which is in fact derived from path).
Here is what I did:
Install OpenFisca France on Windows using Conda and an
environment.yaml
Here is what I expected to happen:
Install with success.
Here is what actually happened:
error: unable to create file openfisca_france_reforms/plf_2022/parameters/prestations_sociales/prestations_etat_de_sante/invalidite/aah/abattement_conjoint_salarie_forfait_enfant.yaml: Filename too long
In OpenFisca-France we enforce a limit of 150 character for path parameters.
But it is not enought because Conda (or pip ?) use a temp path named
C:\Users\bcourty\AppData\Local\Temp\pip-install-oboo5tz8\openfisca-france-reforms_9411943aa5784ca9bcc79d7d516ec176\
So the sum is above the 260 characters limit of Windows.
Here is data (or links to it) that can help you reproduce this issue:
environment.yaml
content:Context
I identify more as a: