Skip to content

Commit c613442

Browse files
author
David Rickett
committed
move check_date_modified.py to tools/ update references to this file.
1 parent 6fc355d commit c613442

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Check-For-Black:
3838
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
3939
changes:
4040
- src/**/*.py
41+
- tools/*.py
4142

4243
Check-HLA-Modified-Dates:
4344
stage: validate
@@ -48,7 +49,7 @@ Check-HLA-Modified-Dates:
4849
- pip install typer
4950
script:
5051
- cd $CI_PROJECT_DIR
51-
- python src/easyhla/check_date_modified.py check-dates
52+
- python tools/check_date_modified.py check-dates
5253
allow_failure: false
5354
rules:
5455
- if: $CI_JOB_MANUAL

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ path = "src/easyhla/__about__.py"
4747

4848
[tool.hatch.build]
4949
include = [
50-
"src/entrypoint.py",
5150
"src/easyhla/*.py",
5251
"src/easyhla/*.csv",
5352
"src/easyhla/hla_nuc.fasta.mtime",
@@ -121,9 +120,9 @@ parallel = true
121120
omit = [
122121
"src/easyhla/__init__.py",
123122
"src/easyhla/__about__.py",
124-
"src/easyhla/check_date_modified.py",
125123
"tests/__init__.py",
126124
"src/easyhla/entrypoint.py",
125+
"tools/*.py"
127126
]
128127

129128
[tool.coverage.report]
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from math import ceil
2424
from typing import List, Tuple
2525
from datetime import datetime
26-
from .easyhla import DATE_FORMAT
26+
from src.easyhla.easyhla import DATE_FORMAT
2727

2828
app = typer.Typer()
2929

@@ -34,7 +34,7 @@ def _list_files() -> List[Tuple[str, int]]:
3434
date as an ISO timestamp.
3535
"""
3636
file_mtime: List[Tuple[str, int]] = []
37-
dir = os.path.dirname(__file__)
37+
dir = os.path.join(os.path.dirname(__file__), "../src/easyhla/")
3838
for file_name in os.listdir(dir):
3939
if file_name.endswith(".csv"):
4040
file_mtime.append(
@@ -63,7 +63,7 @@ def get_latest_mtime():
6363

6464

6565
def _get_mtime_file() -> str:
66-
return os.path.join(os.path.dirname(__file__), "hla_nuc.fasta.mtime")
66+
return os.path.join(os.path.dirname(__file__), "../src/easyhla/hla_nuc.fasta.mtime")
6767

6868

6969
@app.command()
@@ -118,8 +118,8 @@ def _check_dates() -> bool:
118118
"""
119119
Compare the date on record to the last modified date.
120120
"""
121-
latest_file_date = int(_get_latest_mtime().strftime("%Y%m%d"))
122-
last_recorded_date = int(_get_last_recorded_mtime().strftime("%Y%m%d"))
121+
latest_file_date = int(_get_latest_mtime().strftime("%Y-%m-%d"))
122+
last_recorded_date = int(_get_last_recorded_mtime().strftime("%Y-%m-%d"))
123123
print("Last Modified Date:", latest_file_date)
124124
print("Last Recorded Date:", last_recorded_date)
125125
if latest_file_date == last_recorded_date:

0 commit comments

Comments
 (0)