From 0c7ddc2e802374af00029bd258884ce8e96ab3a5 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 30 Apr 2024 13:00:01 +0200 Subject: [PATCH] :sparkles: setup pyproject.toml file - :bug: if namespaces are used by default, this can lead to subpackages being installed... --- pyproject.toml | 66 ++++++++++++++++++++++++++++++++++++++++++++++-- setup.cfg | 49 ----------------------------------- setup.py | 1 + vaep/__init__.py | 24 +++++++++++------- 4 files changed, 80 insertions(+), 60 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 07de284aa..9cc7c395d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,65 @@ +[project] +authors = [{ name = "Henry Webel", email = "henry.webel@sund.ku.dk" }] +description = "Imputing (MS-based prote-) omics data using self supervised deep learning models." +name = "pimms-learn" +# This means: Load the version from the package itself. +# See the section below: [tools.setuptools.dynamic] +dynamic = ["version"] +readme = "README.md" +requires-python = ">=3.8, <3.9" +# These are keywords +classifiers = [ + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Intended Audience :: Healthcare Industry", + "Intended Audience :: Science/Research", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Bio-Informatics", +] +dependencies = [ + "njab", + "numpy", + "matplotlib", + "pandas", + "plotly", + "torch", + "scikit-learn>=1.0", + "scipy", + "seaborn<0.13", + "fastai", + "omegaconf", + "tqdm", + "mrmr-selection", + "pingouin", +] + +[project.scripts] +pimms-setup-imputation-comparison = "vaep.cmd_interface.setup_imp_cp_website:main" + +[project.urls] +"Bug Tracker" = "https://github.com/RasmussenLab/pimms/issues" +"Homepage" = "https://github.com/RasmussenLab/pimms" + +[project.optional-dependencies] +docs = [ + "sphinx", + "sphinx-book-theme", + "myst-nb", + "ipywidgets", + "sphinx-new-tab-link!=0.2.2", +] + +[tool.flake8] +max-line-length = 120 +aggressive = 2 +ignore = ["E501"] + [build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" +requires = ["setuptools>=64", "setuptools_scm>=8", "wheel"] + +[tool.setuptools_scm] +# https://setuptools-scm.readthedocs.io/ +# used to pick up the version from the git tags or the latest commit. + +[tool.setuptools.packages.find] +include = ["vaep"] diff --git a/setup.cfg b/setup.cfg index c3dfb14c9..11106afaa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,57 +1,8 @@ -[metadata] -name = pimms-learn -version = attr:vaep.__version__ -description = Imputing (MS-based prote-) omics data using self supervised deep learning models -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/RasmussenLab/pimms -author = Henry Webel -author_email = "Henry Webel" -license = gpl-3.0 -license_files = LICENSE -classifiers = - License :: OSI Approved :: GNU General Public License v3 (GPLv3) - Intended Audience :: Healthcare Industry - Intended Audience :: Science/Research - Programming Language :: Python :: 3 - Topic :: Scientific/Engineering :: Bio-Informatics -[options] -# package_dir = -packages = find: -include_package_data = True -install_requires = - njab - numpy - matplotlib - pandas - plotly - torch - scikit-learn>=1.0 - scipy - seaborn<0.13 - fastai - omegaconf - tqdm - mrmr-selection - pingouin - -[options.extras_require] -docs = - sphinx - sphinx-book-theme - myst-nb - sphinx-new-tab-link!=0.2.2 - [options.packages.find] # where = vaep exclude = test* - -[options.entry_points] -console_scripts = - pimms-setup-imputation-comparison = vaep.cmd_interface.setup_imp_cp_website:main - ###################### # Tool configuration # ###################### diff --git a/setup.py b/setup.py index 8bf1ba938..606849326 100644 --- a/setup.py +++ b/setup.py @@ -1,2 +1,3 @@ from setuptools import setup + setup() diff --git a/vaep/__init__.py b/vaep/__init__.py index 20ad35526..d32eb0b76 100644 --- a/vaep/__init__.py +++ b/vaep/__init__.py @@ -3,30 +3,36 @@ Variatonal autoencoder for proteomics """ from __future__ import annotations -# Set default logging handler to avoid "No handler found" warnings. -import logging -from logging import NullHandler -logging.getLogger(__name__).addHandler(NullHandler()) +# Set default logging handler to avoid "No handler found" warnings. +import logging as _logging +from importlib import metadata -# put into some pandas_cfg.py file and import all import pandas as pd import pandas.io.formats.format as pf -import vaep.pandas -import vaep.plotting +# from . import logging, nb, pandas, plotting import vaep.logging +import vaep.nb +import vaep.pandas import vaep.plotting -import vaep.nb +_logging.getLogger(__name__).addHandler(_logging.NullHandler()) + + +# put into some pandas_cfg.py file and import all + savefig = vaep.plotting.savefig __license__ = 'GPLv3' -__version__ = (0, 2, 0) +__version__ = metadata.version("pimms-learn") +__all__ = ['logging', 'nb', 'pandas', 'plotting', 'savefig'] # set some defaults + + class IntArrayFormatter(pf.GenericArrayFormatter): def _format_strings(self): formatter = self.formatter or '{:,d}'.format