Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Attempting to load from file first #66

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

jlstevens
Copy link
Contributor

Just in case a simple change actually works (very unlikely).

@jlstevens
Copy link
Contributor Author

jlstevens commented Jan 9, 2021

To my great surprise the tests have passed. I can't think through the consequences of this change other than to state the obvious:

  1. This means no attempt to call git if the .version file is found (good)
  2. In turn this means there are bound to be cases where a stale .version file is read instead of using the correct information available from git (bad).

@jlstevens
Copy link
Contributor Author

Currently the .version file is updated whenever git is available and setup.py is run.

For this PR to work we want:

  1. .version file to be generated for release and only releases (pip, conda (for the defaults, conda-forge, pyviz channels)
  2. It should not be created for any other case (or at worst removed).

Options for generating the .version file:

  1. Condition setup.py to only make the version file based on sys.argv (e.g. sdist versus develop). One issue is that the conda meta.yaml uses install to build the release. However, there may be other indications that a .version file should be written (e.g --single-version-externally-managed?).

  2. Have some way to explicitly write a .version during a release process (e.g on CI). This might be a console script e.g. autover --record-version.

@jlstevens jlstevens force-pushed the checking_file_first branch from e9e09f5 to 645d40a Compare February 9, 2021 09:48
@jbednar
Copy link
Contributor

jbednar commented Feb 9, 2021

I'm happy with either option, favoring option 1 if we can make the generated .version file be deleted automatically after creating the package. If it's not practical to ensure that the .version file gets cleaned up, I'd favor option 2 so that the file is generated explicitly and then deleted explicitly; automatically generating it without automatically deleting it seems like it will lead to many problems with stale .version files.

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

Successfully merging this pull request may close these issues.

2 participants