Skip to content

Commit

Permalink
Add dependencies and cleanup GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lumbric committed May 7, 2024
1 parent ac64762 commit 1f54468
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 441 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/dev.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Tests

on: push

jobs:
test:
runs-on: ubuntu-latest

# strategy:
# matrix:
# python-versions: ['3.7', '3.8', '3.9', '3.10']

steps:
- name: Set up Git repository
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies

- name: Install syfop and dependencies
run: |
sudo apt-get install graphviz graphviz-dev # for pygraphviz
python -m pip install --upgrade pip
python -m pip install -e .[dev,test,extra]
- name: Lint with flake8
run: flake8

- name: Lint with black
run: black --check .

- name: Run unit tests (except the ones using Gurobi and CPLEX)
shell: bash -l {0}
run: python -m pytest --cov=. --cov-report=lcov -k "not gurobi and not cplex" tests

- name: Coveralls test coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


[![MIT License](https://img.shields.io/github/license/inwe-boku/syfop.svg)](https://choosealicense.com/licenses/mit/)
[![CI](https://github.com/inwe-boku/syfop/actions/workflows/dev.yml/badge.svg)](https://github.com/inwe-boku/syfop/actions)
[![CI](https://github.com/inwe-boku/syfop/actions/workflows/tests.yml/badge.svg)](https://github.com/inwe-boku/syfop/actions/workflows/tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/inwe-boku/syfop/badge.svg)](https://coveralls.io/github/inwe-boku/syfop)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![DOI](https://zenodo.org/badge/550867861.svg)](https://zenodo.org/doi/10.5281/zenodo.10869438)
Expand Down Expand Up @@ -40,16 +40,17 @@ see [demo.ipynb](notebooks/demo.ipynb)
How to install
--------------

At the moment there is no package built for syfop. Use conda to setup an environment and then use
`syfop` directly from a cloned Git repository:
At the moment there is no package built for syfop, but it can be installed via pip directly from the
repository:

git clone https://github.com/inwe-boku/syfop/
conda update -f env.yml
conda activate syfop
pre-commit install
pip install git+https://github.com/inwe-boku/syfop

The solver HiGHs is installed automatically . Other [solvers](https://linopy.readthedocs.io/en/latest/solvers.html) are supported too, but not installed automatically.

To install development requirements run:

The conda environment contains the solver HiGHs. Other [solvers](https://linopy.readthedocs.io/en/latest/solvers.html) are supported too, but not included in the conda environment.
pip install -e 'syfop[test,dev] @ git+https://github.com/inwe-boku/syfop'
pre-commit install

<!--
To install Gurobiy:
Expand Down
Loading

0 comments on commit 1f54468

Please sign in to comment.