Skip to content

Replace versioneer with setuptools_scm#196

Merged
santisoler merged 23 commits intomasterfrom
setuptools_scm
Oct 21, 2020
Merged

Replace versioneer with setuptools_scm#196
santisoler merged 23 commits intomasterfrom
setuptools_scm

Conversation

@santisoler
Copy link
Member

@santisoler santisoler commented Oct 13, 2020

Replace versioneer with setuptools_scm for getting Semver version of
Harmonica. setuptools_scm doesn't require to store additional files to work,
it can be installed and used through setup.py. Remove all versioneer
related files and mentions. Add setuptools_scm to requirements.txt and
environment.yml. Replace setup.cfg for .flake8.
Set local_scheme = "no-local-version" on deploy.yml GitHub Action before
publishing to Test PyPI.

Related to fatiando/maintenance#4

@santisoler santisoler changed the title WIP Replace versioneer with setuptools_scm Replace versioneer with setuptools_scm Oct 13, 2020
@santisoler santisoler requested a review from leouieda October 13, 2020 20:27
@santisoler
Copy link
Member Author

santisoler commented Oct 14, 2020

After discussing this with @leouieda, we decided to set local_scheme = "no-local-version" by default. This makes easier to upload to Test PyPI without any shananigans on the Actions workflow and we actually don't need the version to have the commit hash or a date, just to know that we are on an untagged commit. More information can be obtained with git status.

After this decision, setuptools_scm will raise error if we try to install the dev version of Harmonica though pip in the following way:
pip install https://github.com/fatiando/harmonica.

Instead, we would need to do so with:

pip install git+https://github.com/fatiando/harmonica

But this requires git to be installed (it clones the repository instead of downloading a tarball).

So we need to update installing instructions for latest development version to use pip install git+https://github.com/fatiando/harmonica instead of pip install https://..., and add a note that this step now requires git installed.

Remove the HARMONICA_VERSION_LOCAL_SCHEME env variable, simplify
deploy.yml Action and update installation instructions for the latest
development version.
Add a `version` variable that stores the semver version of the package,
and the old `full_version` that adds the `v` before it, which is useful
for docs building and tags.
@santisoler
Copy link
Member Author

After discussing this with @leouieda, we decided to set local_scheme = "no-local-version" by default. This makes easier to upload to Test PyPI without any shananigans on the Actions workflow and we actually don't need the version to have the commit hash or a date, just to know that we are on an untagged commit. More information can be obtained with git status.

After this decision, setuptools_scm will raise error if we try to install the dev version of Harmonica though pip in the following way:
pip install https://github.com/fatiando/harmonica.

Instead, we would need to do so with:

pip install git+https://github.com/fatiando/harmonica

But this requires git to be installed (it clones the repository instead of downloading a tarball).

So we need to update installing instructions for latest development version to use pip install git+https://github.com/fatiando/harmonica instead of pip install https://..., and add a note that this step now requires git installed.

So it seems that not adding the local version string gets in conflict with Pooch, specifically on detecting if Pooch should use version or version_dev for creating the cache folder:

https://github.com/fatiando/pooch/blob/1f60c6ffe143a233bf15b5d1d1ac5acc648504ba/pooch/core.py#L380-L381

https://github.com/fatiando/pooch/blob/1f60c6ffe143a233bf15b5d1d1ac5acc648504ba/pooch/utils.py#L108-L151

I'll try to restore the default behaviour of local_scheme and add some shananingans with sed on the Actions workflow for publishing to TestPyPI.

Restore doc/install.rst. Replace local_scheme configuration before
publishing to TestPyPI on deploy.yml Action.
@santisoler santisoler merged commit 371fff9 into master Oct 21, 2020
@santisoler santisoler deleted the setuptools_scm branch October 21, 2020 19:05
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

Successfully merging this pull request may close these issues.

1 participant