Skip to content

Commit

Permalink
Harden how setuptools_scm resolves versions in tox in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Nov 1, 2023
1 parent d06c8be commit f3feb80
Show file tree
Hide file tree
Showing 23 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions girder/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions girder_annotation/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -25,7 +25,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/bioformats/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/deepzoom/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/dicom/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/dummy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/gdal/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/mapnik/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/multi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/nd2/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/ometiff/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/openjpeg/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/openslide/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/pil/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
2 changes: 1 addition & 1 deletion sources/rasterio/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/test/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/tiff/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/tifffile/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/vips/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions sources/zarr/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -27,7 +27,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
4 changes: 2 additions & 2 deletions utilities/converter/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def prerelease_local_scheme(version):
"""
from setuptools_scm.version import get_local_node_and_date

if os.getenv('CIRCLE_BRANCH') in ('master', ) and not os.getenv('TOX_ENV_NAME'):
if os.getenv('CIRCLE_BRANCH') in ('master', ):
return ''
else:
return get_local_node_and_date(version)
Expand All @@ -30,7 +30,7 @@ def prerelease_local_scheme(version):
from setuptools_scm import get_version

version = get_version(root='../..', local_scheme=prerelease_local_scheme)
limit_version = f'>={version}' if '+' not in version else ''
limit_version = f'>={version}' if '+' not in version and not os.getenv('TOX_ENV_NAME') else ''
except (ImportError, LookupError):
limit_version = ''

Expand Down
Loading

0 comments on commit f3feb80

Please sign in to comment.