Skip to content

Commit 9330cb5

Browse files
Mike LeeMike Lee
authored andcommitted
removing script stubs where possible
1 parent 70538ae commit 9330cb5

5 files changed

Lines changed: 33 additions & 32 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
- downloads only happen in http now, no more ftp, so the -P flag to specify http has been removed
2727
- added optional output dir
2828
- no longer keeping stubs in scripts/, instead keeping a ton of entry points in pyproject.toml
29+
- `bit-filter-seqs-by-length` renamed to `bit-filter-fasta-by-length` to be more specific (prior retained for now)
2930

3031

3132

bit/modules/general.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,24 @@ def attempt_to_make_dir(dir_path):
119119
os.makedirs(dir_path, exist_ok=True)
120120
except Exception as e:
121121
report_failure(f"Failed to create directory '{dir_path}' with the following error:\n{e}")
122+
123+
124+
def report_version():
125+
126+
from datetime import datetime
127+
from importlib.metadata import version
128+
129+
ver = f"v{version('bit')}"
130+
print()
131+
print(f"{' ' * 22} Bioinformatics Tools (bit) {color_text(ver, 'green')}")
132+
print(f"{' ' * 25} github.com/AstrobioMike/bit\n")
133+
134+
print(" If you happen to find this toolset useful in your work, please be sure to")
135+
print(" cite it :)\n")
136+
137+
print(" Lee M. bit: a multipurpose collection of bioinformatics tools. F1000Research 2022, 11:122")
138+
print(" https://doi.org/10.12688/f1000research.79530.1\n")
139+
140+
today = datetime.today().strftime('%A')
141+
signoff = f"Happy {today} :)"
142+
print(f" {color_text(signoff,'green')}\n")

bit/scripts/bit-version

Lines changed: 0 additions & 20 deletions
This file was deleted.

bit/tests/conftest.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ def pytest_sessionstart(session):
2727
not_modularized = []
2828

2929
for file in script_files:
30-
# pseudo-ignoring bit-version for this purpose
31-
if file.name == "bit-version":
32-
python_scripts.append(file)
33-
modularized.append(file)
34-
continue
3530

3631
# checking if helper script
3732
if file.name.startswith("helper-bit-"):
@@ -55,23 +50,25 @@ def pytest_sessionstart(session):
5550

5651
if 'if __name__ == "__main__"' in first_ten:
5752
modularized.append(file)
58-
print(file)
5953
else:
6054
not_modularized.append(file)
6155

6256
print("\n ====================================================================================================")
6357
print(" ================================= Progress on modularizing scripts =================================")
6458
print(" ====================================================================================================\n")
6559

66-
print(f" Legacy script files remaining: {len(script_files)}\n")
60+
print(f" Legacy-script files remaining: {len(script_files)}\n")
6761
print(f" Total helper scripts: {len(helper_scripts)}")
6862
print(f" Total bash scripts: {len(bash_scripts)}")
6963
print(f" Total python scripts: {len(python_scripts)}")
70-
print(f" Python scripts modularized: {len(modularized)}")
71-
print(f" Python scripts not yet modularized: {len(not_modularized)}\n")
64+
# print(f" Python scripts modularized: {len(modularized)}")
65+
# print(f" Python scripts not yet modularized: {len(not_modularized)}\n")
66+
67+
# if not_modularized:
68+
# print(" Files not yet modularized:\n")
69+
# print_two_columns(not_modularized)
7270

73-
if not_modularized:
74-
print(" Files not yet modularized:\n")
75-
print_two_columns(not_modularized)
71+
print("\n Remainig legacy scripts:\n")
72+
print_two_columns(script_files)
7673

7774
print("\n ====================================================================================================\n")

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ include-package-data = true
2020
bit = ["tests/data/*", "smk/*.smk", "smk/envs/*"]
2121

2222
[project.scripts]
23+
bit-version = "bit.modules.general:report_version"
24+
2325
## ncbi-related ##
2426
bit-dl-ncbi-assemblies = "bit.cli.dl_ncbi_assemblies:main"
2527
get-ncbi-assembly-tables = "bit.modules.ncbi.get_ncbi_assembly_tables:main"

0 commit comments

Comments
 (0)