From 16e94c7e6df2ee6f4f72cb625fc5305219382524 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Thu, 26 Oct 2023 12:30:44 -0400 Subject: [PATCH] build: use pyproject.toml for build configuration --- .gitignore | 2 +- pyproject.toml | 73 ++++++++++++++++++- setup.cfg | 69 ------------------ setup.py | 5 -- {disease => src/disease}/__init__.py | 0 {disease => src/disease}/cli.py | 0 {disease => src/disease}/database/__init__.py | 0 {disease => src/disease}/database/database.py | 0 {disease => src/disease}/database/dynamodb.py | 0 .../disease}/database/postgresql.py | 0 .../database/postgresql/add_fkeys.sql | 0 .../database/postgresql/add_indexes.sql | 0 .../postgresql/create_record_lookup_view.sql | 0 .../database/postgresql/create_tables.sql | 0 .../postgresql/delete_normalized_concepts.sql | 0 .../database/postgresql/drop_fkeys.sql | 0 .../database/postgresql/drop_indexes.sql | 0 {disease => src/disease}/etl/__init__.py | 0 {disease => src/disease}/etl/base.py | 0 {disease => src/disease}/etl/do.py | 0 {disease => src/disease}/etl/merge.py | 0 {disease => src/disease}/etl/mondo.py | 0 {disease => src/disease}/etl/ncit.py | 0 {disease => src/disease}/etl/omim.py | 0 {disease => src/disease}/etl/oncotree.py | 0 {disease => src/disease}/main.py | 0 {disease => src/disease}/query.py | 0 {disease => src/disease}/schemas.py | 0 {disease => src/disease}/version.py | 0 29 files changed, 73 insertions(+), 76 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py rename {disease => src/disease}/__init__.py (100%) rename {disease => src/disease}/cli.py (100%) rename {disease => src/disease}/database/__init__.py (100%) rename {disease => src/disease}/database/database.py (100%) rename {disease => src/disease}/database/dynamodb.py (100%) rename {disease => src/disease}/database/postgresql.py (100%) rename {disease => src/disease}/database/postgresql/add_fkeys.sql (100%) rename {disease => src/disease}/database/postgresql/add_indexes.sql (100%) rename {disease => src/disease}/database/postgresql/create_record_lookup_view.sql (100%) rename {disease => src/disease}/database/postgresql/create_tables.sql (100%) rename {disease => src/disease}/database/postgresql/delete_normalized_concepts.sql (100%) rename {disease => src/disease}/database/postgresql/drop_fkeys.sql (100%) rename {disease => src/disease}/database/postgresql/drop_indexes.sql (100%) rename {disease => src/disease}/etl/__init__.py (100%) rename {disease => src/disease}/etl/base.py (100%) rename {disease => src/disease}/etl/do.py (100%) rename {disease => src/disease}/etl/merge.py (100%) rename {disease => src/disease}/etl/mondo.py (100%) rename {disease => src/disease}/etl/ncit.py (100%) rename {disease => src/disease}/etl/omim.py (100%) rename {disease => src/disease}/etl/oncotree.py (100%) rename {disease => src/disease}/main.py (100%) rename {disease => src/disease}/query.py (100%) rename {disease => src/disease}/schemas.py (100%) rename {disease => src/disease}/version.py (100%) diff --git a/.gitignore b/.gitignore index 36c18880..2fca62fa 100644 --- a/.gitignore +++ b/.gitignore @@ -149,7 +149,7 @@ pytest.ini # ignore data dir data/* -disease/data/* +src/disease/data/* # IDE materials .idea/ diff --git a/pyproject.toml b/pyproject.toml index c988649d..beee8f69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,78 @@ +[project] +name = "disease-normalizer" +authors = [ + {name = "Alex Wagner"}, + {name = "Kori Kuzma"}, + {name = "James Stevenson"} +] +readme = "README.md" +classifiers = [ + "Development Status :: 3 - Alpha", + "Framework :: FastAPI", + "Framework :: Pydantic", + "Framework :: Pydantic :: 2", + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "Topic :: Scientific/Engineering :: Bio-Informatics", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +requires-python = ">=3.8" +description = "VICC normalization routines for diseases" +license = {file = "LICENSE"} +dependencies = [ + "pydantic==2.*", + "fastapi", + "uvicorn", + "click", + "boto3", + "ga4gh.vrs~=2.0.0a1", +] +dynamic = ["version"] + +[project.optional-dependencies] +pg = ["psycopg[binary]"] +etl = ["owlready2==0.40", "rdflib", "requests", "typing-extensions", "bioversions"] +test = ["pytest>=6.0", "pytest-cov"] +dev = ["pre-commit", "black", "ruff", "lxml", "xmlformatter"] + +[project.urls] +Homepage = "https://github.com/cancervariants/disease-normalization" +Documentation = "https://github.com/cancervariants/disease-normalization" +Changelog = "https://github.com/cancervariants/disease-normalization/releases" +Source = "https://github.com/cancervariants/disease-normalization" +"Bug Tracker" = "https://github.com/cancervariants/disease-normalization/issues" + +[project.scripts] +disease_norm_update = "disease.cli:update_normalizer_db" +disease_norm_update_remote = "disease.cli:update_from_remote" +disease_norm_dump = "disease.cli:dump_database" +disease_norm_check_db = "disease.cli:check_db" + [build-system] -requires = ["setuptools", "wheel"] +requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" +[tool.setuptools.dynamic] +version = {attr = "disease.version.__version__"} + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +"disease.database.postgresql" = ["*.sql"] + +[tool.pytest.ini_options] +addopts = "--cov=src --cov-report term-missing" +testpaths = ["tests"] + +[tool.coverage.run] +branch = true + [tool.black] line-length = 88 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 61e2a5e6..00000000 --- a/setup.cfg +++ /dev/null @@ -1,69 +0,0 @@ -[metadata] -name = disease-normalizer -author = VICC -author_email = help@cancervariants.org -description = VICC normalization routine for diseases -long_description = file:README.md -long_description_content_type = text/markdown -home-page = https://github.com/cancervariants/disease-normalization -license-file = LICENSE -license = MIT - -classifiers = - Development Status :: 3 - Alpha - Intended Audience :: Science/Research - Intended Audience :: Developers - Topic :: Scientific/Engineering :: Bio-Informatics - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - -[options] -packages = find: -python_requires = >=3.8 -zip_safe = False - -install_requires = - pydantic - fastapi >= 0.72.0 - uvicorn - boto3 - click - ga4gh.vrs ~= 2.0.0a1 - -[options.package_data] -disease = - database/postgresql/* - -[options.entry_points] -console_scripts = - disease_norm_update = disease.cli:update_db - disease_norm_update_remote = disease.cli:update_from_remote - disease_norm_dump = disease.cli:dump_database - disease_norm_check_db = disease.cli:check_db - -[options.extras_require] -etl = - owlready2==0.40 - rdflib - requests - typing-extensions - bioversions - -dev = - pre-commit - lxml - xmlformatter - black - ruff - -pg = - psycopg[binary] - -test = - pytest - pytest-cov - -[tool:pytest] -testpaths = tests/unit -addopts = --ignore=setup.py --ignore=analysis/ --ignore=tests/scripts/ --doctest-modules --cov-report term-missing --cov=. diff --git a/setup.py b/setup.py deleted file mode 100644 index 82246113..00000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Defines packaging and distribution.""" -from setuptools import setup - -exec(open("disease/version.py").read()) -setup(version=__version__) # noqa: F821 diff --git a/disease/__init__.py b/src/disease/__init__.py similarity index 100% rename from disease/__init__.py rename to src/disease/__init__.py diff --git a/disease/cli.py b/src/disease/cli.py similarity index 100% rename from disease/cli.py rename to src/disease/cli.py diff --git a/disease/database/__init__.py b/src/disease/database/__init__.py similarity index 100% rename from disease/database/__init__.py rename to src/disease/database/__init__.py diff --git a/disease/database/database.py b/src/disease/database/database.py similarity index 100% rename from disease/database/database.py rename to src/disease/database/database.py diff --git a/disease/database/dynamodb.py b/src/disease/database/dynamodb.py similarity index 100% rename from disease/database/dynamodb.py rename to src/disease/database/dynamodb.py diff --git a/disease/database/postgresql.py b/src/disease/database/postgresql.py similarity index 100% rename from disease/database/postgresql.py rename to src/disease/database/postgresql.py diff --git a/disease/database/postgresql/add_fkeys.sql b/src/disease/database/postgresql/add_fkeys.sql similarity index 100% rename from disease/database/postgresql/add_fkeys.sql rename to src/disease/database/postgresql/add_fkeys.sql diff --git a/disease/database/postgresql/add_indexes.sql b/src/disease/database/postgresql/add_indexes.sql similarity index 100% rename from disease/database/postgresql/add_indexes.sql rename to src/disease/database/postgresql/add_indexes.sql diff --git a/disease/database/postgresql/create_record_lookup_view.sql b/src/disease/database/postgresql/create_record_lookup_view.sql similarity index 100% rename from disease/database/postgresql/create_record_lookup_view.sql rename to src/disease/database/postgresql/create_record_lookup_view.sql diff --git a/disease/database/postgresql/create_tables.sql b/src/disease/database/postgresql/create_tables.sql similarity index 100% rename from disease/database/postgresql/create_tables.sql rename to src/disease/database/postgresql/create_tables.sql diff --git a/disease/database/postgresql/delete_normalized_concepts.sql b/src/disease/database/postgresql/delete_normalized_concepts.sql similarity index 100% rename from disease/database/postgresql/delete_normalized_concepts.sql rename to src/disease/database/postgresql/delete_normalized_concepts.sql diff --git a/disease/database/postgresql/drop_fkeys.sql b/src/disease/database/postgresql/drop_fkeys.sql similarity index 100% rename from disease/database/postgresql/drop_fkeys.sql rename to src/disease/database/postgresql/drop_fkeys.sql diff --git a/disease/database/postgresql/drop_indexes.sql b/src/disease/database/postgresql/drop_indexes.sql similarity index 100% rename from disease/database/postgresql/drop_indexes.sql rename to src/disease/database/postgresql/drop_indexes.sql diff --git a/disease/etl/__init__.py b/src/disease/etl/__init__.py similarity index 100% rename from disease/etl/__init__.py rename to src/disease/etl/__init__.py diff --git a/disease/etl/base.py b/src/disease/etl/base.py similarity index 100% rename from disease/etl/base.py rename to src/disease/etl/base.py diff --git a/disease/etl/do.py b/src/disease/etl/do.py similarity index 100% rename from disease/etl/do.py rename to src/disease/etl/do.py diff --git a/disease/etl/merge.py b/src/disease/etl/merge.py similarity index 100% rename from disease/etl/merge.py rename to src/disease/etl/merge.py diff --git a/disease/etl/mondo.py b/src/disease/etl/mondo.py similarity index 100% rename from disease/etl/mondo.py rename to src/disease/etl/mondo.py diff --git a/disease/etl/ncit.py b/src/disease/etl/ncit.py similarity index 100% rename from disease/etl/ncit.py rename to src/disease/etl/ncit.py diff --git a/disease/etl/omim.py b/src/disease/etl/omim.py similarity index 100% rename from disease/etl/omim.py rename to src/disease/etl/omim.py diff --git a/disease/etl/oncotree.py b/src/disease/etl/oncotree.py similarity index 100% rename from disease/etl/oncotree.py rename to src/disease/etl/oncotree.py diff --git a/disease/main.py b/src/disease/main.py similarity index 100% rename from disease/main.py rename to src/disease/main.py diff --git a/disease/query.py b/src/disease/query.py similarity index 100% rename from disease/query.py rename to src/disease/query.py diff --git a/disease/schemas.py b/src/disease/schemas.py similarity index 100% rename from disease/schemas.py rename to src/disease/schemas.py diff --git a/disease/version.py b/src/disease/version.py similarity index 100% rename from disease/version.py rename to src/disease/version.py