Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ENH: Check git.Repo.is_dirty() on all editable installs #17

Open
Jacob-Stevens-Haas opened this issue Dec 17, 2023 · 2 comments
Open

ENH: Check git.Repo.is_dirty() on all editable installs #17

Jacob-Stevens-Haas opened this issue Dec 17, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@Jacob-Stevens-Haas
Copy link
Owner

Currently, mitosis checks to see that the current working directory, if under git version control, is dirty (uncommitted changes). It also logs the commit hash of the current repo. This assumes a project organization where the experimental package and no others is installed in editable mode, because installed editable packages under setuptools_scm use the version number at the time of install.

However, there's no reason to assume that (a) mitosis is called from within the relevant git repo, and (b) no reason to assume that only one repo is installed in editable mode.

Install metadata in site-packages/<package.version>.dist-info/direct-url.json includes the value {editable: True} (PEP 660/610). But since packages and installers have multiple ways of installing packages, I'm not sure how to reliably get that file without assumptions. There's been discussions back and forth about whether this will end up on packaging or importlib.metadata, but it looks like the latter. See:

CPython PR, importlib_metadata backport PR

Once the latter of those PRs is merged, I can add this feature. I don't want to add a hacky workaround just to fix it in a few months.

@Jacob-Stevens-Haas
Copy link
Owner Author

See recommendation at https://discuss.python.org/t/place-for-a-direct-url-json-parser/26266/10. I need to file a bug with setuptools

@Jacob-Stevens-Haas Jacob-Stevens-Haas added this to the 0.4.0 Desiderata milestone Jan 3, 2024
@Jacob-Stevens-Haas Jacob-Stevens-Haas added the enhancement New feature or request label Jan 3, 2024
@Jacob-Stevens-Haas
Copy link
Owner Author

Bug in setuptools has a workaround - see pypa/setuptools#4170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant