Skip to content

Commit

Permalink
build!: define in pyproject.toml (#285)
Browse files Browse the repository at this point in the history
* use `src/` layout
* define build configs in `pyproject.toml` using `setuptools-scm` rather than `version.py`
* update some associated metadata
  • Loading branch information
jsstevenson authored Jul 16, 2024
1 parent 2548408 commit cb83cb3
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 68 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
**/.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down Expand Up @@ -176,8 +176,8 @@ yarn-debug.log*
yarn-error.log*
frontend/public/
frontend/node_modules
node_modules/
**/node_modules/
**/.yarn

# Data
server/curfu/data
client/node_modules
server/src/curfu/data
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021-2022 Alex H. Wagner
Copyright (c) 2021-2024 Genomic Medicine Lab

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: sh -c 'cd ./server/ && gunicorn -k uvicorn.workers.UvicornWorker curfu.main:app --timeout 1000 --log-level debug'
web: sh -c 'cd ./server/src/ && gunicorn -k uvicorn.workers.UvicornWorker curfu.main:app --timeout 1000 --log-level debug'
2 changes: 0 additions & 2 deletions server/curfu/version.py

This file was deleted.

71 changes: 69 additions & 2 deletions server/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,73 @@
[project]
name = "curfu"
authors = [
{name = "Alex Wagner", email = "[email protected]"},
{name = "Kori Kuzma", email = "[email protected]"},
{name = "James Stevenson", email = "[email protected]"},
{name = "Katie Stahl", email = "[email protected]"},
{name = "Jeremy Arbesfeld", email = "[email protected]"}
]
readme = "README.md"
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.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.10"
description = "Curation tool for gene fusions"
license = {file = "../LICENSE"}
dependencies = [
"fastapi >= 0.72.0",
"aiofiles",
"asyncpg",
"fusor ~= 0.0.30-dev1",
"sqlparse >= 0.4.2",
"urllib3 >= 1.26.5",
"click",
"jinja2",
"boto3",
]
dynamic = ["version"]

[project.optional-dependencies]
tests = [
"pytest",
"pytest-asyncio >= 0.19.0",
"pytest-cov",
"coverage",
"httpx",
]
dev = [
"psycopg2-binary",
"ruff",
"black",
"pre-commit>=3.7.1",
"gene-normalizer ~= 0.1.39",
"pydantic-to-typescript",
]

[project.scripts]
curfu_devtools = "curfu.cli:devtools"
curfu = "curfu.cli:serve"

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta:__legacy__"
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools_scm]

[tool.pytest.ini_options]
addopts = "--cov=src --cov-report term-missing"
testpaths = ["tests"]

[tool.black]
line-length = 88
Expand Down
50 changes: 0 additions & 50 deletions server/setup.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions server/setup.py

This file was deleted.

8 changes: 7 additions & 1 deletion server/curfu/__init__.py → server/src/curfu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
"""Fusion curation interface."""
import logging
from importlib.metadata import PackageNotFoundError, version
from os import environ
from pathlib import Path

from .version import __version__
try:
__version__ = version("curfu")
except PackageNotFoundError:
__version__ = "unknown"
finally:
del version, PackageNotFoundError

# provide consistent paths
APP_ROOT = Path(__file__).resolve().parents[0]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion server/curfu/main.py → server/src/curfu/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from starlette.templating import _TemplateResponse as TemplateResponse

from curfu import APP_ROOT
from curfu import __version__ as curfu_version
from curfu.domain_services import DomainService
from curfu.gene_services import GeneService
from curfu.routers import (
Expand All @@ -19,7 +20,6 @@
utilities,
validate,
)
from curfu.version import __version__ as curfu_version

fastapi_app = FastAPI(
title="Fusion Curation API",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from fastapi import APIRouter
from fusor import __version__ as fusor_version

from curfu import __version__ as curfu_version
from curfu.schemas import RouteTag, ServiceInfoResponse
from curfu.version import __version__ as curfu_version

router = APIRouter()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cb83cb3

Please sign in to comment.