Skip to content

Commit

Permalink
moving to the hatch build system, no other changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ialbert committed Apr 9, 2024
1 parent bf9498a commit d73662b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 63 deletions.
20 changes: 9 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ all: serve

# Run the tests.
test:
@python biorun/test.py
@python src/biorun/test.py

# Update the usage data.
testdata:
Expand Down Expand Up @@ -47,16 +47,14 @@ push:

# Build Python package.
build:
python setup.py sdist bdist_wheel

# Upload new version to PyPI.
pypi: test build
rm -rf dist build
python setup.py bdist_wheel
#python -m twine upload --repository testpypi dist/*
python -m twine upload --repository pypi dist/*


rm -rf build dist
hatch build
ls -lh dist

# Publish the package
publish: test build
hatch publish

#REMOTE=www@biostarhandbook.com:/home/www/book/data_www/bio

# Upload prebuilt data to distribution site.
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,17 @@ dependencies = [
'gprofiler-official'
]

[tool.hatch.metadata]
include = [
'src/biorun/*',
]

[project.scripts]
"bio" = "biorun.__main__:run"
"fasta_filter.py" = "biorun.scripts.fasta_filter:run"

[tool.hatch.build.targets.wheel]
include = ["src/biorun/data/*"]
packages = [
"src/biorun",
]
Expand All @@ -54,6 +64,8 @@ dependencies = [
"coverage[toml]>=6.5",
"pytest",
]
path=".venv"

[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
Expand Down
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

8 changes: 7 additions & 1 deletion src/biorun/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ def main():
print(f"*** error: {exc}")
sys.exit(1)

if expect != result:
# Initialize the SequenceMatcher with the file contents
matcher = difflib.SequenceMatcher(None, expect, result)

# Publihsed data may be slightly different.
ratio = matcher.ratio()

if ratio < 0.9:
print(f"running: {cmd}")
print_diff(expect=expect, result=result)
print(f"\n\n(cd {DATA_DIR} && {cmd})\n")
Expand Down

0 comments on commit d73662b

Please sign in to comment.