diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 29628919..9b4d47ef 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,6 +39,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + with: + lfs: false # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/conda-installation-not-in-path.yaml b/.github/workflows/conda-installation-not-in-path.yaml index 71560a08..2655c5c9 100644 --- a/.github/workflows/conda-installation-not-in-path.yaml +++ b/.github/workflows/conda-installation-not-in-path.yaml @@ -20,6 +20,8 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 - uses: actions/checkout@v2 + with: + lfs: false - name: Install miniconda run: | diff --git a/.github/workflows/conda-installation.yaml b/.github/workflows/conda-installation.yaml index 49451f12..ea80c544 100644 --- a/.github/workflows/conda-installation.yaml +++ b/.github/workflows/conda-installation.yaml @@ -20,6 +20,8 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 - uses: actions/checkout@v2 + with: + lfs: false - uses: conda-incubator/setup-miniconda@v2 with: diff --git a/.github/workflows/demo.yaml b/.github/workflows/demo.yaml index 5176b521..b22c5f56 100644 --- a/.github/workflows/demo.yaml +++ b/.github/workflows/demo.yaml @@ -26,6 +26,8 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 - uses: actions/checkout@v2 + with: + lfs: false - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index a207379f..817e2f24 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, "3.10"] + python-version: [3.8, "3.10"] # Check the oldest and newest currently supported Python versions steps: diff --git a/.github/workflows/installation-from-remote.yaml b/.github/workflows/installation-from-remote.yaml index d97adc56..7486877d 100644 --- a/.github/workflows/installation-from-remote.yaml +++ b/.github/workflows/installation-from-remote.yaml @@ -23,6 +23,8 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 - uses: actions/checkout@v2 + with: + lfs: false - uses: conda-incubator/setup-miniconda@v2 with: @@ -49,6 +51,8 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 - uses: actions/checkout@v2 + with: + lfs: false - uses: conda-incubator/setup-miniconda@v2 with: @@ -84,10 +88,12 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 - uses: actions/checkout@v2 + with: + lfs: false - uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.10' - name: Install ConFlowGen run: | diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 5785260a..79234c9a 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -11,7 +11,7 @@ on: jobs: build: - name: Check code quality with pylint and flake8 + name: Check code quality with pylint, flake8, and flake8_nb runs-on: ubuntu-latest strategy: @@ -25,6 +25,8 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 - uses: actions/checkout@v2 + with: + lfs: false - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml index 27191bf0..2cc33ea1 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/unittests.yaml @@ -20,11 +20,13 @@ jobs: uses: fkirc/skip-duplicate-actions@v3.4.1 - uses: actions/checkout@v2 + with: + lfs: false - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.10" - name: Install Python dependencies run: | diff --git a/.readthedocs.yaml b/.readthedocs.yaml index da81fc18..aa84968f 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: "3.9" + python: "3.10" # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/docs/conf.py b/docs/conf.py index 2b594e80..73e2edd6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,7 @@ from matplotlib.font_manager import fontManager fontManager.get_default_size() # just some random action so that the import is not flagged as unnecessary -# include conflowgen from source code, avoid getting served an outdated installation +# include conflowgen from source code, avoid being served an outdated installation sys.path.insert( 0, os.path.abspath( @@ -176,14 +176,17 @@ def _install_git_lfs_on_linux_on_the_fly() -> str: return _git_lfs_cmd os.system("echo 'Installing git-lfs on-the-fly'") - version = 'v3.0.2' + version = 'v3.2.0' file_to_download = f'git-lfs-linux-amd64-{version}.tar.gz' + folder_inside_file = f"git-lfs-{version[1:]}" if not os.path.isfile(file_to_download): os.system( f'wget https://github.com/git-lfs/git-lfs/releases/download/{version}/{file_to_download}' ) # download git lfs - os.system(f'tar xvfz git-lfs-linux-amd64-{version}.tar.gz -C ./.tools') # extract to ./.tools subdirectory - os.system('cp ./.tools/git-lfs ./git-lfs') # take command (don't care about readme etc.) + os.system(f'tar xvfz {file_to_download} -C ./.tools') # extract to ./.tools subdirectory + os.system(f'ls ./.tools/') + os.system(f'ls ./.tools/{folder_inside_file}') + os.system(f'cp ./.tools/{folder_inside_file}/git-lfs ./git-lfs') # take command (don't care about readme etc.) os.system('./git-lfs install') # make lfs available in current repository os.system("echo 'git-lfs is installed'") return _git_lfs_cmd diff --git a/run_ci_light.bat b/run_ci_light.bat index de98e8e7..730a08de 100644 --- a/run_ci_light.bat +++ b/run_ci_light.bat @@ -1,19 +1,53 @@ @ECHO OFF +ECHO. ECHO.Please run this batch script as a substitute of the GitHub workflows before creating a pull request. This light ECHO.version does not run the following CI pipelines: ECHO.- CodeQL analysis (only used by GitHub) -ECHO.- Installing ConFlowGen in a fresh conda environment (not suitable for repeated invocation) +ECHO.- Installing ConFlowGen from source in a fresh conda environment (not suitable for repeated invocation) +ECHO. +ECHO.This script needs to be invoked in the development environment, e.g., a virtual environment or a conda +ECHO.environment. ECHO. -ECHO.This script needs to be invoked in the development environment (e.g., a virtual environment or a conda -ECHO.environment). -REM run tests -python -m pytest --exitfirst --verbose --failed-first --cov="./conflowgen" --cov-report html || ECHO.Tests failed && EXIT /B +ECHO.The following Python interpreter is used: +python -c "import sys; print(sys.base_prefix)" + +ECHO.The following sys.prefix is used (typically overwritten by the isolated environment you operate in): +python -c "import sys; print(sys.prefix)" +ECHO. + +IF "%VIRTUAL_ENV%" NEQ "" ( + ECHO.Operating inside the virtual environment %VIRTUAL_ENV% + GOTO START_PIPELINE +) + +IF "%CONDA_PREFIX%" NEQ "" ( + ECHO.Operating inside the conda environment %CONDA_PREFIX% + GOTO START_PIPELINE +) -REM try installation process - as a developer this is the default installation anyways +ECHO.It seems like you are not in an isolated development environment. In a later step, the current version of +ECHO.ConFlowgen will be installed as a library. Please abort if you do not want to clutter your Python installation. +ECHO.If you actually are in an isolated development environment, feel free to improve this check. + +:AGAIN +ECHO. +set /p answer="Continue anyway (Y/N)? " +if /i "%answer:~,1%" EQU "Y" goto START_PIPELINE +if /i "%answer:~,1%" EQU "N" exit /b +ECHO.Please type Y for Yes or N for No +GOTO AGAIN + + +:START_PIPELINE +REM Try the installation process - as a developer this is the default installation anyway +REM This also ships the commands that are used in the latter stages of the pipeline python -m pip install -e .[dev] || ECHO.Installation failed && EXIT /B +REM run tests +python -m pytest --exitfirst --verbose --failed-first --cov="./conflowgen" --cov-report html || ECHO.Tests failed && EXIT /B + REM check code quality flake8 || ECHO.While linting, flake8 failed && EXIT /B flake8_nb || ECHO.While linting, flake8_nb failed && EXIT /B