Skip to content

Commit

Permalink
refactor: Move install.py
Browse files Browse the repository at this point in the history
As the python interpreter only adds the parent directory of the
executed script as module search path and we depend on `fact_extractor`
the file must be placed next to the `fact_extractor` module.
  • Loading branch information
maringuu committed Sep 12, 2024
1 parent df60480 commit 197d629
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: ./fact_extractor/install/pre_install.sh
- name: Install fact_extractor
shell: 'script -q -e -c "bash {0}"'
run: ./fact_extractor/install.py
run: ./install.py
- name: Unit Tests
shell: 'script -q -e -c "bash {0}"'
run: pytest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN --mount=type=cache,target=/var/cache/apt \
ADD . /app
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/root/.cache/pip \
/app/fact_extractor/install.py
/app/install.py


ENTRYPOINT ["/app/fact_extractor/docker_extraction.py"]
4 changes: 2 additions & 2 deletions fact_extractor/install.py → install.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import sys
from pathlib import Path

from version import __VERSION__
from fact_extractor.version import __VERSION__

import distro

Expand Down Expand Up @@ -98,7 +98,7 @@ def main():
distribution = check_distribution()

logging.info(f'{PROGRAM_NAME} {PROGRAM_VERSION}')
installation_directory = str(Path(__file__).parent / 'install')
installation_directory = str(Path(__file__).parent / 'fact_extractor' / 'install')

with OperateInDirectory(installation_directory):
common(distribution)
Expand Down

0 comments on commit 197d629

Please sign in to comment.