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 how some sources are referenced in setup.py. #1064

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 1.20.1

### Bug Fixes
- Fix packaging listing various source requirements ([#1064](../../pull/1064))

## 1.20.0

### Features
Expand Down
11 changes: 2 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import itertools
import os
import sys

from setuptools import setup

Expand Down Expand Up @@ -45,10 +44,12 @@ def prerelease_local_scheme(version):
sources = {
'bioformats': [f'large-image-source-bioformats{limit_version}'],
'deepzoom': [f'large-image-source-deepzoom{limit_version}'],
'dicom': [f'large-image-source-dicom{limit_version} ; python_version < "3.8"'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be python_version >= "3.8"? That's what it is with what was removed.

As is, this means anyone above Python 3.7 cannot install this source

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Fixed and testing.

'dummy': [f'large-image-source-dummy{limit_version}'],
'gdal': [f'large-image-source-gdal{limit_version}'],
'mapnik': [f'large-image-source-mapnik{limit_version}'],
'multi': [f'large-image-source-multi{limit_version}'],
'nd2': [f'large-image-source-nd2{limit_version} ; python_version < "3.7"'],
'ometiff': [f'large-image-source-ometiff{limit_version}'],
'openjpeg': [f'large-image-source-openjpeg{limit_version}'],
'openslide': [f'large-image-source-openslide{limit_version}'],
Expand All @@ -58,14 +59,6 @@ def prerelease_local_scheme(version):
'tifffile': [f'large-image-source-tifffile{limit_version}'],
'vips': [f'large-image-source-vips{limit_version}'],
}
if sys.version_info >= (3, 7):
sources.update({
'nd2': [f'large-image-source-nd2{limit_version}'],
})
if sys.version_info >= (3, 8):
sources.update({
'dicom': [f'large-image-source-dicom{limit_version}'],
})
extraReqs.update(sources)
extraReqs['sources'] = list(set(itertools.chain.from_iterable(sources.values())))
extraReqs['all'] = list(set(itertools.chain.from_iterable(extraReqs.values())))
Expand Down
10 changes: 9 additions & 1 deletion sources/vips/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ def prerelease_local_scheme(version):
return get_local_node_and_date(version)


try:
from setuptools_scm import get_version

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

setup(
name='large-image-source-vips',
use_scm_version={'root': '../..', 'local_scheme': prerelease_local_scheme,
Expand All @@ -45,7 +53,7 @@ def prerelease_local_scheme(version):
'Programming Language :: Python :: 3.11',
],
install_requires=[
'large-image',
f'large-image{limit_version}',
'numpy',
'packaging',
'pyvips',
Expand Down