Skip to content

Commit 5b1ce0a

Browse files
authored
Merge pull request #86 from Adamtaranto/update_packaging
Update_packaging
2 parents 3a993b9 + 5c14eab commit 5b1ce0a

File tree

259 files changed

+129
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+129
-74
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Mac stuff
2+
.DS_Store
3+
4+
# Versioning
5+
src/pyfastaq/_version.py
6+
7+
# Byte-compiled / optimized / DLL files
8+
__pycache__/
19
*.py[cod]
210

311
# C extensions

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: python
22
python:
3-
- "3.4"
3+
- "3.8"
44
sudo: false
55
script:
6-
- "python setup.py test"
6+
- "pip install . && pytest tests"

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 20 additions & 9 deletions

environment.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: fastaq
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
dependencies:
6+
- python 3.12
7+
- hatch
8+
- pytest

pyproject.toml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Build system configuration
2+
[build-system]
3+
requires = ["hatchling", "hatch-vcs"]
4+
build-backend = "hatchling.build"
5+
6+
# Project metadata
7+
[project]
8+
name = "pyfastaq"
9+
description = "Script to manipulate FASTA and FASTQ files, plus API for developers."
10+
readme="README.md"
11+
requires-python = ">=3.8"
12+
license = { text = "GPLv3" }
13+
authors = [
14+
{ name = "Martin Hunt", email = "path-help@sanger.ac.uk" },
15+
]
16+
17+
# The classifiers for the project.
18+
classifiers = [
19+
"Development Status :: 4 - Beta",
20+
"Topic :: Scientific/Engineering :: Bio-Informatics",
21+
"Programming Language :: Python :: 3 :: Only",
22+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)"
23+
]
24+
25+
# The dependencies required to install the package.
26+
dependencies = []
27+
28+
# Dynamic versioning
29+
dynamic = ["version"]
30+
31+
# Project URLs
32+
[project.urls]
33+
homepage = "https://github.com/sanger-pathogens/Fastaq"
34+
documentation = "https://github.com/sanger-pathogens/Fastaq"
35+
repository = "https://github.com/sanger-pathogens/Fastaq"
36+
37+
# Command-line script entry point
38+
[project.scripts]
39+
fastaq="pyfastaq.app_fastaq:main"
40+
41+
# Hatch build configuration
42+
[tool.hatch.build]
43+
source = "src"
44+
45+
# Exclude files and directories from the build
46+
exclude = [
47+
"environment.yml",
48+
]
49+
50+
# Hatch versioning configuration
51+
[tool.hatch.version]
52+
source = "vcs"
53+
54+
# Version control system (VCS) versioning
55+
[tool.hatch.version.vcs]
56+
tag-pattern = "v*" # Git tags starting with 'v' will be used for versioning
57+
fallback-version = "0.0.0"
58+
59+
# Version file location for VCS
60+
[tool.hatch.build.hooks.vcs]
61+
version-file = "src/pyfastaq/_version.py"
62+
63+
# Optional dependencies for testing
64+
[project.optional-dependencies]
65+
tests = ["pytest"]

setup.py

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
from pkg_resources import get_distribution
2-
3-
try:
4-
__version__ = get_distribution('pyfastaq').version
5-
except:
6-
__version__ = 'local'
7-
8-
1+
from pyfastaq._version import __version__
92

103
__all__ = [
114
'caf',
@@ -16,4 +9,5 @@
169
'intervals',
1710
'runners'
1811
]
12+
1913
from pyfastaq import *

scripts/fastaq renamed to src/pyfastaq/app_fastaq.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
import argparse
42
import sys
53

@@ -57,16 +55,20 @@ def print_usage_and_exit():
5755
sys.exit(1)
5856

5957

60-
if len(sys.argv) == 1 or sys.argv[1] in ['-h', '-help', '--help']:
61-
print_usage_and_exit()
58+
def main():
59+
if len(sys.argv) == 1 or sys.argv[1] in ['-h', '-help', '--help']:
60+
print_usage_and_exit()
61+
62+
task = sys.argv.pop(1)
6263

63-
task = sys.argv.pop(1)
64+
if task not in tasks:
65+
print('Task "' + task + '" not recognised. Cannot continue.\n', file=sys.stderr)
66+
print_usage_and_exit()
6467

65-
if task not in tasks:
66-
print('Task "' + task + '" not recognised. Cannot continue.\n', file=sys.stderr)
67-
print_usage_and_exit()
6868

69+
exec('import pyfastaq.runners.' + task)
70+
exec('pyfastaq.runners.' + task + '.run("' + tasks[task] + '")')
6971

70-
exec('import pyfastaq.runners.' + task)
71-
exec('pyfastaq.runners.' + task + '.run("' + tasks[task] + '")')
7272

73+
if __name__ == "__main__":
74+
main()
File renamed without changes.

0 commit comments

Comments
 (0)