Skip to content
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
6 changes: 2 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#
import os
import sys
from importlib.metadata import version as md_version

import matplotlib
# fix for `ImportError: No module named _tkinter`:
Expand All @@ -25,10 +26,7 @@

sys.path.insert(0, os.path.abspath('../../vip_hci/'))

with open(os.path.join(os.path.abspath('../../vip_hci/'), '__init__.py')) as init:
for line in init:
if "__version__ =" in line:
version = line.split('"')[1]
version = md_version('vip_hci')


# -- General configuration ------------------------------------------------
Expand Down
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [ "pip", "setuptools>=77" ]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: I've used setuptools>=77 here to get support for PEP 639 license specification (project.license-files), but unfortunately this version of setuptools isn't available for Python 3.8. Would it be okay to also drop support for this end-of-life version of Python too ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm in support of dropping it but Valentin should make the final call


[project]
name = "vip_hci"
version = "1.6.6"
description = "Package for astronomical high-contrast image processing."
readme = "README.rst"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name = "Carlos Alberto Gomez Gonzalez" },
{ name = "Valentin Christiaens", email = "[email protected]" },
]
requires-python = ">=3.8"
classifiers = [
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Astronomy",
]
urls.Homepage = "https://github.com/vortex-exoplanet/VIP"

[tool.setuptools]
zip-safe = false
packages.find = { namespaces = false }
43 changes: 0 additions & 43 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
import os
import re

from setuptools import setup
try:
Expand Down Expand Up @@ -58,52 +57,10 @@ def resource(*args):
except:
requirements_dev = [str(ir.req) for ir in reqs_dev]

with open(resource('README.rst')) as readme_file:
README = readme_file.read()

with open(resource('vip_hci', '__init__.py')) as version_file:
version_file = version_file.read()
VERSION = re.search(r"""^__version__ = ['"]([^'"]*)['"]""",
version_file, re.M)
VERSION = VERSION.group(1)


PACKAGES = ['vip_hci',
'vip_hci.config',
'vip_hci.fits',
'vip_hci.fm',
'vip_hci.greedy',
'vip_hci.invprob',
'vip_hci.metrics',
'vip_hci.objects',
'vip_hci.preproc',
'vip_hci.psfsub',
'vip_hci.stats',
'vip_hci.var']

setup(
name='vip_hci',
version=VERSION,
description='Package for astronomical high-contrast image processing.',
long_description=README,
license='MIT',
author='Carlos Alberto Gomez Gonzalez, Valentin Christiaens',
author_email='[email protected]',
url='https://github.com/vortex-exoplanet/VIP',
cmdclass={'install': InstallReqs,
'develop': InstallDevReqs},
packages=PACKAGES,
install_requires=requirements,
extras_require={"dev": requirements_dev},
zip_safe=False,
classifiers=['Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Natural Language :: English',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering :: Astronomy'
]
)
11 changes: 9 additions & 2 deletions vip_hci/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
__version__ = "1.6.6"

from . import preproc
from . import config
from . import fits
Expand All @@ -11,3 +9,12 @@
from . import var
from . import objects
from .vip_ds9 import *

__version__ = "1.6.6"
# TODO: replace static __version__ with the following dynamic lookup
# (requires CI test against a built package rather than the source tree)
# def __getattr__(name: str):
# if name == '__version__':
# from importlib.metadata import version
# return version('vip_hci')
# raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
4 changes: 3 additions & 1 deletion vip_hci/config/utils_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from functools import wraps
import multiprocessing
import warnings
from vip_hci import __version__

sep = "―" * 80
vip_figsize = (8, 5)
Expand Down Expand Up @@ -44,6 +43,7 @@ def save(self, filename):


"""
from vip_hci import __version__ # TODO: replace this with importlib.metadata.version

vip_object = self.__class__.__name__

Expand All @@ -70,6 +70,8 @@ def save(self, filename):

@classmethod
def load(cls, filename):
from vip_hci import __version__ # TODO: replace this with importlib.metadata.version

try:
data = np.load(filename, allow_pickle=True)
except BaseException:
Expand Down