Skip to content

Commit

Permalink
Update version numbers, include small improvements in pipelines (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
1kastner authored Jul 20, 2022
1 parent 905b5b6 commit 89d6c03
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/conda-installation-not-in-path.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
uses: fkirc/[email protected]

- uses: actions/checkout@v2
with:
lfs: false

- name: Install miniconda
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/conda-installation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
uses: fkirc/[email protected]

- uses: actions/checkout@v2
with:
lfs: false

- uses: conda-incubator/setup-miniconda@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
uses: fkirc/[email protected]

- uses: actions/checkout@v2
with:
lfs: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/installation-from-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
uses: fkirc/[email protected]

- uses: actions/checkout@v2
with:
lfs: false

- uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -49,6 +51,8 @@ jobs:
uses: fkirc/[email protected]

- uses: actions/checkout@v2
with:
lfs: false

- uses: conda-incubator/setup-miniconda@v2
with:
Expand Down Expand Up @@ -84,10 +88,12 @@ jobs:
uses: fkirc/[email protected]

- 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: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -25,6 +25,8 @@ jobs:
uses: fkirc/[email protected]

- uses: actions/checkout@v2
with:
lfs: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ jobs:
uses: fkirc/[email protected]

- 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: |
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 7 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
46 changes: 40 additions & 6 deletions run_ci_light.bat
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 89d6c03

Please sign in to comment.