diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 1dc73e6..845d0d3 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -19,6 +19,10 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.7 + - name: Install codecov and erase coverage + run: | + python -m pip install "$(cat test-requirements.txt | grep codecov)" + coverage erase - name: Run Minimum Dependency Generator with 1 file id: min_dep_gen_1 uses: ./ diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index b99647a..32a15a7 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -24,4 +24,4 @@ jobs: python -m pip install -r requirements.txt python -m pip install -r test-requirements.txt coverage erase - make test + make testcoverage diff --git a/Dockerfile b/Dockerfile index 2ffcd74..1af9f47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,7 @@ FROM python:3.7 ADD minimum_dependency_generator minimum_dependency_generator ADD requirements.txt requirements.txt -ADD main.py main.py RUN pip install pip --upgrade --progress-bar off RUN pip install -r requirements.txt --progress-bar off -ENTRYPOINT ["python", "/main.py"] +ENTRYPOINT ["python", "/minimum_dependency_generator/main.py"] diff --git a/Makefile b/Makefile index 984acb6..c2530b3 100644 --- a/Makefile +++ b/Makefile @@ -21,4 +21,4 @@ test: lint .PHONY: testcoverage testcoverage: lint - pytest minimum_dependency_generator/ --cov=minimum_dependency_generator --cov-config=../.coveragerc --cache-clear --show-capture=stderr + pytest minimum_dependency_generator/ --cov=minimum_dependency_generator --cov-config=.coveragerc --cache-clear --show-capture=stderr diff --git a/main.py b/minimum_dependency_generator/main.py similarity index 98% rename from main.py rename to minimum_dependency_generator/main.py index 3de60ad..e39b934 100644 --- a/main.py +++ b/minimum_dependency_generator/main.py @@ -1,8 +1,8 @@ from argparse import ArgumentParser -import os from minimum_dependency_generator import generate_min_requirements + def main(): parser = ArgumentParser(description="reads a requirements file and outputs the minimized requirements") parser.add_argument('--requirements_paths', nargs='+', @@ -17,5 +17,6 @@ def main(): def sanitize_string(s): return s.replace("%", "%25").replace("\r", "%0D").replace("\n", "%0A") + if __name__ == '__main__': main()