Skip to content

Commit

Permalink
Update python-app.yml (#45)
Browse files Browse the repository at this point in the history
* Update python-app.yml 

- Replace conda install, see s-weigand/setup-conda#432
- Update https://github.com/actions/checkout

* Use ts-graphviz/setup-graphviz@v2

See https://github.com/marketplace/actions/setup-graphviz
Replaces `conda install -c anaconda graphviz` on MacOS

* Use psycopg2-binary 

Fixes
```
 Error: pg_config executable not found.
      
      pg_config is required to build psycopg2 from source.  Please add the directory
      containing pg_config to the $PATH or specify the full executable path with the
      option:
      
          python setup.py build_ext --pg-config /path/to/pg_config build ...
      
      or with the pg_config option in 'setup.cfg'.
      
      If you prefer to avoid building psycopg2 from source, please install the PyPI
      'psycopg2-binary' package instead.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
```

* Update setup.py
  • Loading branch information
VaeterchenFrost committed Jul 5, 2024
1 parent 8b93608 commit 2bd527b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v2
Expand Down Expand Up @@ -73,32 +73,34 @@ jobs:
continue-on-error: true

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Conda
uses: s-weigand/setup-conda@v1
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
# Whether to activate the conda base env (Default: 'true')
activate-conda: true
# If conda should be updated before running other commands (Default: 'false')
update-conda: true
# Python version which should be installed with conda (default: 'Default')
python-version: 3.8

- name: Install Workflow dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
- name: Brew graphviz
- name: Install graphviz for visualization test
if: ${{ runner.os == 'macOS' }}
run: |
brew install graphviz
# execute dot
dot -V
sudo dot -c
uses: ts-graphviz/setup-graphviz@v2
with:
macos-skip-brew-update: 'true' # default false

- name: install graphviz for visualization test
- name: Setup Conda
if: ${{ runner.os == 'Windows' }}
uses: s-weigand/setup-conda@v1
with:
# Whether to activate the conda base env (Default: 'true')
activate-conda: true
# Python version which should be installed with conda (default: 'Default')
python-version: 3.8

- name: Install graphviz via conda
if: ${{ runner.os == 'Windows' }}
run: |
conda install -c anaconda graphviz
Expand All @@ -109,7 +111,6 @@ jobs:
# should give base conda python
$python=Get-Command python
$pypath=Split-Path $python.Source -Parent
# Add to PATH, we know pypath is on it
$dot=[IO.Path]::Combine($pypath, 'Library', 'bin', 'graphviz')
echo $dot | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
graphviz~=0.20
hypothesis~=6.82.0
psycopg2~=2.9.6
psycopg2-binary~=2.9.6
python-benedict~=0.32.0
python-benedict[xml]~=0.32.0
pytest~=7.4.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def read_files(files, delim: str = "\n") -> str:
license='GPLv3',
packages=['tdvisu'],
platforms='any',
install_requires=['graphviz', 'psycopg2', 'python-benedict', 'python-benedict[xml]', 'PyYAML'],
install_requires=['graphviz', 'psycopg2-binary', 'python-benedict', 'python-benedict[xml]', 'PyYAML'],
extras_require={'test': tests_require},
classifiers=classifiers,
keywords='graph visualization dynamic-programming msol-solver')

0 comments on commit 2bd527b

Please sign in to comment.