From 6568b83ff5f06a416b38bb443b370cdd5d97cc71 Mon Sep 17 00:00:00 2001 From: shoulinwei Date: Fri, 8 Dec 2023 22:58:00 +0800 Subject: [PATCH] fix ver and deps --- README.md | 1 - csst_dfs_api_local/{msc => mbi}/__init__.py | 0 csst_dfs_api_local/{msc => mbi}/level2.py | 0 csst_dfs_api_local/{msc => mbi}/level2co.py | 0 csst_dfs_api_local/version.py | 1 + requirements.txt | 11 +++- setup.cfg | 26 ++++---- setup.py | 66 ++++++++++++++++++++- tests/test_msc_level2_catalog.py | 2 +- 9 files changed, 91 insertions(+), 16 deletions(-) rename csst_dfs_api_local/{msc => mbi}/__init__.py (100%) rename csst_dfs_api_local/{msc => mbi}/level2.py (100%) rename csst_dfs_api_local/{msc => mbi}/level2co.py (100%) create mode 100644 csst_dfs_api_local/version.py diff --git a/README.md b/README.md index 73640e5..a8f4f65 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ This library can be installed with the following command: ```bash git clone https://github.com/astronomical-data-processing/csst-dfs-api-local.git cd csst-dfs-api-local -pip install -r requirements.txt python setup.py install ``` diff --git a/csst_dfs_api_local/msc/__init__.py b/csst_dfs_api_local/mbi/__init__.py similarity index 100% rename from csst_dfs_api_local/msc/__init__.py rename to csst_dfs_api_local/mbi/__init__.py diff --git a/csst_dfs_api_local/msc/level2.py b/csst_dfs_api_local/mbi/level2.py similarity index 100% rename from csst_dfs_api_local/msc/level2.py rename to csst_dfs_api_local/mbi/level2.py diff --git a/csst_dfs_api_local/msc/level2co.py b/csst_dfs_api_local/mbi/level2co.py similarity index 100% rename from csst_dfs_api_local/msc/level2co.py rename to csst_dfs_api_local/mbi/level2co.py diff --git a/csst_dfs_api_local/version.py b/csst_dfs_api_local/version.py new file mode 100644 index 0000000..d538f87 --- /dev/null +++ b/csst_dfs_api_local/version.py @@ -0,0 +1 @@ +__version__ = "1.0.0" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 260ec3e..043d647 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,9 @@ -DBUtils==1.3 -astropy>=4.0 \ No newline at end of file +# base +astropy==5.3.4 +pandas==2.0.3 +networkx==3.2.1 +matplotlib==3.7.2 +numpy==1.26.1 +healpy==1.16.6 +# specific +DBUtils==1.3 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 3b0228a..53ba43d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,21 +7,25 @@ description = CSST DFS Local APIs Library. long_description = file: README.md long_description_content_type = text/markdown keywords = astronomy, astrophysics, cosmology, space, CSST -url = https://github.com/astronomical-data-processing/csst-dfs-api-local -project_urls = - Bug Tracker = https://github.com/astronomical-data-processing/csst-dfs-api-local/issues -classifiers = - Programming Language :: Python :: 3 - License :: OSI Approved :: MIT License - Operating System :: OS Independent +url = https://csst-tb.bao.ac.cn/code/csst-dfs/csst-dfs-api-local + +[bumpver] +current_version = "1.0.0" +version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]" +commit_message = "Release {new_version}" +commit = True +tag = True +push = True + +[bumpver:file_patterns] +setup.cfg = + current_version = "{version}" +csst_dfs_api/version.py = + __version__ = "{version}" [options] -packages = find: python_requires = >=3.7 zip_safe = False -setup_requires = setuptools_scm -install_requires = - DBUtils==1.3 [options.package_data] csst_dfs_api_local.common = *.sql [options.entry_points] diff --git a/setup.py b/setup.py index a0ef8a6..f0cf02d 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,69 @@ # coding: utf-8 import os from setuptools import setup +setup_pars = { + "packages" : [ + 'csst_dfs_api_local', + 'csst_dfs_api_local.common', + 'csst_dfs_api_local.cpic', + 'csst_dfs_api_local.facility', + 'csst_dfs_api_local.hstdm', + 'csst_dfs_api_local.ifs', + 'csst_dfs_api_local.mbi', + 'csst_dfs_api_local.mci', + 'csst_dfs_api_local.sls', + ], + "package_dir" : { + 'csst_dfs_api_local' : 'csst_dfs_api_local', + 'csst_dfs_api_local.common' : 'csst_dfs_api_local/common', + 'csst_dfs_api_local.cpic' : 'csst_dfs_api_local/cpic', + 'csst_dfs_api_local.facility' : 'csst_dfs_api_local/facility', + 'csst_dfs_api_local.hstdm' : 'csst_dfs_api_local/hstdm', + 'csst_dfs_api_local.ifs' : 'csst_dfs_api_local/ifs', + 'csst_dfs_api_local.mbi' : 'csst_dfs_api_local/mbi', + 'csst_dfs_api_local.mci' : 'csst_dfs_api_local/mci', + 'csst_dfs_api_local.sls' : 'csst_dfs_api_local/sls', + }, +} + +def requirements(): + with open("requirements.txt", "r") as f: + return [ + req.strip() + for req in f.readlines() + if not req.startswith("#") and req.__contains__("==") + ] + +def version(): + __version = {} + version_path = os.path.join(os.path.dirname(__file__), "csst_dfs_api_local", "version.py") + with open(version_path, "r") as file: + exec(file.read(), __version) + return __version["__version__"] + +setup( + name="csst_dfs_api_local", + version=version(), + description="API's to access CSST Data Flow System (DFS)", + long_description=open('README.md').read(), + license="MIT", + python_requires=">=3.7", + install_requires=requirements(), + zip_safe=False, + classifiers=[ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Scientific/Engineering :: Astronomy", + + ], + include_package_data=False, + project_urls={ + 'Source': 'https://csst-tb.bao.ac.cn/code/csst-dfs/csst-dfs-api-local', + }, + **setup_pars +) -setup(use_scm_version={'write_to': os.path.join('csst_dfs_api_local', '_version.py')}) diff --git a/tests/test_msc_level2_catalog.py b/tests/test_msc_level2_catalog.py index e8bbb8c..4efe281 100644 --- a/tests/test_msc_level2_catalog.py +++ b/tests/test_msc_level2_catalog.py @@ -2,7 +2,7 @@ import os import unittest from astropy.io import fits -from csst_dfs_api_local.msc.level2 import Level2CatalogApi +from csst_dfs_api_local.mbi.level2 import Level2CatalogApi class MSCLevel2CatalogApiTestCase(unittest.TestCase): -- GitLab