Skip to content

Commit

Permalink
Refactored frontend setup configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkc committed Apr 29, 2024
1 parent 0607f60 commit 65bb873
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 66 deletions.
9 changes: 2 additions & 7 deletions frontend/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ include requirements.txt
include requirements-dev.txt

# server
recursive-include gens/templates/ *.html
recursive-include gens/static/**/ *
recursive-include scout/blueprints/**/templates/ *.html
recursive-include scout/blueprints/**/static/ *

# api
include gens/openapi/openapi.yaml
recursive-include app/templates/ *.html
recursive-include app/static/**/ *

# excluding
recursive-exclude * *.py[co]
Expand Down
3 changes: 1 addition & 2 deletions frontend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from .__version__ import VERSION as version
from .app import create_app
from .__version__ import VERSION as __version__
2 changes: 1 addition & 1 deletion frontend/app/blueprints/gens/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from flask import Blueprint, abort, current_app, render_template, request

from app import version
from app import __version__ as version
from app.api import get_sample
from app.io import parse_region_str

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/blueprints/home/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from flask import Blueprint, current_app, render_template, request

from app import version
from app import __version__ as version
from app.api import get_samples, get_timestamps

LOG = logging.getLogger(__name__)
Expand Down
7 changes: 7 additions & 0 deletions frontend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.isort]
profile = "black"
src_paths = ["app"]
1 change: 0 additions & 1 deletion frontend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
gunicorn
.
41 changes: 37 additions & 4 deletions frontend/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
[bumpversion]
current_version = 2.1.1

[metadata]
description-file = README.md
name = gens_app
version = attr: app.__version__
author = Markus Johansson
author_email = [email protected]
classifiers =
Development Status :: 5 - Production/Stable
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12

[options]
packages = find:
zip_safe = True
include_package_data = True
python_requires = >=3.10
install_requires =
setuptools
wheel
flask
gunicorn
flask-compress
requests
pydantic
tabulate

[options.package_data]
app = *.css, *js

[options.extras_require]
dev =
black
isort
mypy
pytest
pytest-cov
pytest-flask

[isort]
profile=black
56 changes: 6 additions & 50 deletions frontend/setup.py
Original file line number Diff line number Diff line change
@@ -1,53 +1,9 @@
# coding: utf-8
#!/usr/bin/env python
"""Build frontend with setuptools.
from os import path
Build is defined in setup.cfg"""

from setuptools import find_packages, setup
import setuptools

setup(
name="gens",
version="2.1.1",
description="Gens is a web-based interactive tool to visualize genomic copy number profiles from WGS data.",
license="MIT",
author="Ronja, Markus Johansson",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
keywords=["Flask", "Genomics", "WGS"],
packages=find_packages(),
zip_safe=False,
install_requires=[
"Flask",
"pydantic",
"gtfparse>=1.2.0",
"pysam>=0.15.4",
"pyyaml",
"flask-compress",
"tabulate",
"requests",
],
setup_requires=["pytest-runner"],
tests_require=["pytest", "mongomock"],
entry_points={
"console_scripts": ["gens=gens.commands:cli"],
},
package_data={
"gens": [
"gens/templates/*.html",
"gens/static/**/*",
"gens/static/**/*",
"scout/blueprints/**/templates/*.html",
"scout/blueprints/**/static/*",
"gens/openapi/openapi.yaml",
]
},
include_package_data=True,
)
if __name__ == "__main__":
setuptools.setup()

0 comments on commit 65bb873

Please sign in to comment.