From 029b994813a979f51b2112ff3d4854f509abf579 Mon Sep 17 00:00:00 2001 From: kpotoh Date: Fri, 25 Oct 2024 17:17:16 +0200 Subject: [PATCH] package healed --- pymutspec/__init__.py | 2 +- pyproject.toml | 30 ++++++++++++-- scripts/{ => legacy}/binom_test.py | 0 scripts/legacy/setup.py | 63 ++++++++++++++++++++++++++++++ setup.py | 48 +---------------------- 5 files changed, 92 insertions(+), 51 deletions(-) rename scripts/{ => legacy}/binom_test.py (100%) create mode 100644 scripts/legacy/setup.py diff --git a/pymutspec/__init__.py b/pymutspec/__init__.py index 9d465c7..7d0b805 100644 --- a/pymutspec/__init__.py +++ b/pymutspec/__init__.py @@ -1,4 +1,4 @@ from pymutspec import annotation, draw, io, constants, utils # Define the pymutspec version -__version__ = "0.0.11" \ No newline at end of file +__version__ = "0.0.12" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 234cb2b..7c93600 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,39 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + [project] name = "PyMutSpec" -version = "0.0.11" +version = "0.0.12" +description = "Mutational spectra analysis package" authors = [ { name="kpotoh", email="axepon@mail.ru" }, ] -description = "Mutational spectra analysis package" license = { file = "LICENSE" } -readme = "README.md" +readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" classifiers = [ + "Operating System :: OS Independent", + "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Bio-Informatics", + "Topic :: Software Development :: Libraries :: Python Modules", "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", +] +dependencies = [ + "numpy~=1.22.2", + "pandas~=1.4.0", + "seaborn==0.12.2", + "biopython==1.79", + "ete3==3.1.2", + "tqdm~=4.62.3", + "PyYAML~=6.0", + "pytest~=7.1.2", + "click~=8.1.3", ] [project.urls] diff --git a/scripts/binom_test.py b/scripts/legacy/binom_test.py similarity index 100% rename from scripts/binom_test.py rename to scripts/legacy/binom_test.py diff --git a/scripts/legacy/setup.py b/scripts/legacy/setup.py new file mode 100644 index 0000000..5cf0acb --- /dev/null +++ b/scripts/legacy/setup.py @@ -0,0 +1,63 @@ +import os +import re +from setuptools import setup, find_packages + +path_to_pyproject = 'pyproject.toml' + + +def read_specs(path: str): + specs = dict() + with open(path, 'r') as fin: + for line in fin: + if line.startswith('name'): + specs['name'] = re.match('name = "(.+)"', line).group(1) + elif line.startswith('version'): + specs['version'] = re.match('version = "(.+)"', line).group(1) + elif line.startswith('description'): + specs['description'] = re.match('description = "(.+)"', line).group(1) + elif line.startswith('requires-python'): + specs['python_requires'] = re.match('requires-python = "(.+)"', line).group(1) + break + return specs + + +def read_requirements(path: str): + with open(path, encoding="utf-8") as file: + requirements = [] + extra_index_urls = [] + for line in file: + line = line.strip() + if line: + if line.startswith('-f'): + extra_index_urls.append(line.split()[1]) + elif line.startswith('#'): + continue + else: + requirements.append(line) + return requirements, extra_index_urls + + +requirements, _ = read_requirements("requirements.txt") + +scripts = [] +if os.path.exists("scripts"): + for file in os.listdir("scripts"): + if file.endswith(".py") and not file.startswith("_"): + fp = os.path.join("scripts", file) + with open(fp) as fin: + if "python" in fin.readline(): + scripts.append(fp) + +specs = read_specs(path_to_pyproject) + +setup( + author="kpotoh", + author_email="axepon@mail.ru", + url="https://github.com/mitoclub/PyMutSpec", + license="MIT", + install_requires=requirements, + scripts=scripts, + packages=find_packages(), + package_data={'pymutspec': ['utils/configs/log_settings.yaml']}, + **specs +) diff --git a/setup.py b/setup.py index ac28069..e264b64 100644 --- a/setup.py +++ b/setup.py @@ -1,59 +1,15 @@ import os -import re from setuptools import setup, find_packages -path_to_pyproject = 'pyproject.toml' - - -def read_specs(path: str): - specs = dict() - with open(path, 'r') as fin: - for line in fin: - if line.startswith('name'): - specs['name'] = re.match('name = "(.+)"', line).group(1) - elif line.startswith('version'): - specs['version'] = re.match('version = "(.+)"', line).group(1) - elif line.startswith('description'): - specs['description'] = re.match('description = "(.+)"', line).group(1) - elif line.startswith('requires-python'): - specs['python_requires'] = re.match('requires-python = "(.+)"', line).group(1) - break - return specs - - -extra_index_urls = [] -packages = [] scripts = [] - -with open("requirements.txt", encoding="utf-8") as file: - for line in map(str.strip, file): - if line: - if line.startswith("-f"): - extra_index_urls.append(line.split()[1]) - elif line.startswith("#"): - continue - else: - packages.append(line) - if os.path.exists("scripts"): for file in os.listdir("scripts"): if file.endswith(".py") and not file.startswith("_"): fp = os.path.join("scripts", file) - with open(fp) as fin: - if "python" in fin.readline(): - scripts.append(fp) - -specs = read_specs(path_to_pyproject) + scripts.append(fp) setup( - author="kpotoh", - author_email="axepon@mail.ru", - url="https://github.com/mitoclub/PyMutSpec", - license="MIT", - install_requires=packages, - dependency_links=extra_index_urls, - scripts=scripts, packages=find_packages(), + scripts=scripts, package_data={'pymutspec': ['utils/configs/log_settings.yaml']}, - **specs )