Mesnage-Org / pgfinder-jupyterlite

https://mesnage-org.github.io/pgfinder-jupyterlite
0 stars 1 forks source link

Masses are duplicated from the PGFinder package #5

Closed TheLostLambda closed 1 year ago

TheLostLambda commented 1 year ago

A question mostly for @ns-rse I think!

Are the mass files in this repo something you copied over manually? If so, I suppose that would make them out of date after the new dictionaries are merged into pgfinder...

Are you aware of any way to bake these masses into the wheel that gets installed by pip?

TheLostLambda commented 1 year ago

Looks like we are already doing that with the default config and parameter files — they are getting bundled in! I'll try to sort out how to do the same for the mass libraries.

That means that they will get installed by pip too!

TheLostLambda commented 1 year ago

If anyone knows how we're bundling the config files at the moment, it would be helpful to know! Otherwise I'll do my best to figure out which of the (seemingly many) approaches we're already using.

ns-rse commented 1 year ago

You can bundle files into pgfinder by adding them to pyproject.toml under the [tools.setuptools.package-data] section. This requires that the mass files reside under the pgfinder directory as this is the configured location of the package (see section [tools.setuptools.packages.find]. Useful reference for package configuration pysetuptools pyproject.toml configuration.

In moving these files around in pgfinder you may find you have to do some tweaking of both pgfinder and pgfinder-jupyterlite to load them automatically, but definitely not a bad thing as its useful to have a "single point of truth" rather than keeping files in sync between repositories.

TheLostLambda commented 1 year ago

Ah, that makes sense! I'd found package-data, but the data files obviously weren't in the right place to be picked up! I'll give all of that a go today!

TheLostLambda commented 1 year ago

Bizarrely, it doesn't seem like any of those pyproject.toml options were needed (they seem to be set to true by default), but I did need to not only move the masses to the pgfinder directory, but also commit them with git before they were picked up by the wheel builder!

Seems to track with the bit about VCS (as a substitute for a MANIFEST.in file) here: https://setuptools.pypa.io/en/latest/userguide/datafiles.html

TheLostLambda commented 1 year ago

Sorted out now, but I might replace this repo with https://github.com/Mesnage-Org/pgfinder-gui , so I'll close this issue for now!