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

Installation does not work with 'src' package layout #30

Open
kmpf opened this issue Apr 13, 2021 · 4 comments
Open

Installation does not work with 'src' package layout #30

kmpf opened this issue Apr 13, 2021 · 4 comments

Comments

@kmpf
Copy link

kmpf commented Apr 13, 2021

Used miniver as replacement for versioneer. Ran into problem:

FileNotFoundError: [Errno 2] No such file or directory: '<package_name>/_version.py'

Fixed the issue by changing:

spec = spec_from_file_location('version', os.path.join(package_name, '_version.py'))

to:

spec = spec_from_file_location('version', os.path.join('src', package_name, '_version.py'))

adding 'src' to path. This information should be included in the documentation. If I'll find time I'll provide a merge request.

@jbweston
Copy link
Owner

jbweston commented Apr 13, 2021

Thanks for the report @kmpf!

I agree that we need to add documentation for this.

It seems support for 'src' layout was added in v0.7.0 (according to the changelog).
You can use miniver install src/<package_name> instead of miniver install <package_name>.

This can certainly be made more ergonomic (miniver should just auto-detect the src/ layout); I'll take a look into it this weekend

@kmpf
Copy link
Author

kmpf commented Apr 14, 2021

Shall I help out with something. Testing? Providing documentation?

@jbweston
Copy link
Owner

@kmpf thanks!

Documentation would be the easiest place to start; we just need to add a section to the README.
If you want to open a PR for that feel free!

@jbweston
Copy link
Owner

jbweston commented Apr 17, 2021

If you want to take a crack at implemention auto-detection of src layout that would be cool also!

If so we can start a discussion in a separate "feature proposal" issue, or you can directly open a PR and we'll go from there.

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

No branches or pull requests

2 participants