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

Fix import of Harmonica version on sample datasets #264

Merged
merged 5 commits into from
Oct 21, 2021

Conversation

santisoler
Copy link
Member

@santisoler santisoler commented Oct 21, 2021

Create a new version.py file tha defines the __version__ variable as the
version number with a leading v. The new __version__ variable is imported
by __init__.py and by sample_data.py without generating any circular
import. Solves the issue of docs not being built on new releases.

Reminders:

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst and the base __init__.py file for the package.
  • Write detailed docstrings for all functions/classes/methods. It often helps to design better code if you write the docstrings first.
  • If adding new functionality, add an example to the docstring, gallery, and/or tutorials.
  • Add your full name, affiliation, and ORCID (optional) to the AUTHORS.md file (if you haven't already) in case you'd like to be listed as an author on the Zenodo archive of the next release.

Import our own defined `__version__` that has a `v` before the raw version number.
This solves the issue of docs not being built on new releases.
Avoid to "from .. import __version__" because it creates a circular
import.
The current hack is to manually add the "v" directly on sample_data.py
The new __version__ variable is imported by __init__.py and by
sample_data.py without generating any circular import.
harmonica/version.py Outdated Show resolved Hide resolved
harmonica/version.py Outdated Show resolved Hide resolved
@santisoler santisoler merged commit e468287 into master Oct 21, 2021
@santisoler santisoler deleted the fix-sample-data-on-version branch October 21, 2021 13:21
@santisoler santisoler added the bug Report a problem that needs to be fixed label Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report a problem that needs to be fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant