Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ website/core.db
build/
__pycache__/
*.sqlite3
env/
env
3 changes: 0 additions & 3 deletions app/__init__.py

This file was deleted.

27 changes: 17 additions & 10 deletions app/sample_registry/pyproject.toml → pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only",
]

dependencies = [
"sqlalchemy",
"seqbackup @ git+https://github.com/PennChopMicrobiomeProgram/seqBackup.git@master",
]
dependencies = [
"flask",
"flask-sqlalchemy",
"sqlalchemy",
"seqbackup @ git+https://github.com/PennChopMicrobiomeProgram/seqBackup.git@master",
]

[project.optional-dependencies] # Optional
dev = ["black"]
Expand All @@ -56,11 +58,16 @@ export_samples = "sample_registry.export:export_samples"
create_test_db = "sample_registry.db:create_test_db"
sample_registry_version = "sample_registry:sample_registry_version"

[tool.setuptools]

[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools.package-data]
"sample_registry" = [
"templates/*.html",
"static/*",
"static/img/*",
]

[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
version = {attr = "sample_registry.__version__"}
version = {attr = "sample_registry.__version__"}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def sample_registry_version():
sys.stdout.write(
"Missing database connection information in environment, using test SQLite database\n"
)
SQLALCHEMY_DATABASE_URI = f"sqlite:///{Path(__file__).parent.parent.parent.parent.parent.resolve()}/sample_registry.sqlite3"
SQLALCHEMY_DATABASE_URI = f"sqlite:///{Path(__file__).parent.parent.resolve()}/sample_registry.sqlite3"
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path calculation uses multiple .parent calls which is fragile and hard to understand. Consider using a more explicit approach like Path.cwd() or defining a constant for the project root directory.

Copilot uses AI. Check for mistakes.


if "PYTEST_VERSION" in os.environ:
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.
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
@@ -1,5 +1,5 @@
import io
from src.sample_registry.mapping import SampleTable
from sample_registry.mapping import SampleTable


NORMAL_TSV = """\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
from sqlalchemy import and_, create_engine, select
from sqlalchemy.orm import Session, sessionmaker
from typing import Generator
from src.sample_registry.db import create_test_db
from src.sample_registry.mapping import SampleTable
from src.sample_registry.models import (
from sample_registry.db import create_test_db
from sample_registry.mapping import SampleTable
from sample_registry.models import (
Annotation,
Base,
Run,
Sample,
StandardHostSpecies,
StandardSampleType,
)
from src.sample_registry.register import (
from sample_registry.register import (
register_run,
register_sample_annotations,
unregister_samples,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
import pytest
from sqlalchemy import create_engine, func, select
from sqlalchemy.orm import Session, sessionmaker
from src.sample_registry.db import create_test_db
from src.sample_registry.mapping import SampleTable
from src.sample_registry.models import (
from sample_registry.db import create_test_db
from sample_registry.mapping import SampleTable
from sample_registry.models import (
Annotation,
Base,
Run,
Sample,
StandardHostSpecies,
StandardSampleType,
)
from src.sample_registry.registrar import SampleRegistry
)
from sample_registry.registrar import SampleRegistry

recs = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import collections
import io
from src.sample_registry.util import (
from sample_registry.util import (
key_by_attr,
dict_from_eav,
local_filepath,
Expand Down
Loading