Make createuser work for new installations and add basic coverage. #863
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python application | |
on: | |
push: | |
branches: [ "edge" ] | |
pull_request: | |
branches: [ "edge" ] | |
permissions: | |
contents: read | |
jobs: | |
lint-python2-rocky8ish: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
# NOTE: python-2 is no longer supported here - try with apt | |
- name: Set up Python 2.7 with APT and link to default | |
run: | | |
sudo apt install -y python2 python-pip | |
- name: Install dependencies | |
run: | | |
python2 -m pip install --upgrade pip | |
pip2 install flake8 pytest | |
if [ -f requirements.txt ]; then pip2 install -r requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
# TODO: fix unittest dir and remove from excludes | |
# TODO: fix or migrate legacy grsfs-fuse dir and remove from excludes | |
# TODO: should tests be included here - currently fail on py3-only FileNotFoundError, etc. | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --exclude=tests,state,envhelp,fixture,output,unittest,grsfs-fuse,irclib.py,seafile-seahub_settings-template.py --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --exclude=tests,state,envhelp,fixture,output,unittest,grsfs-fuse,vm-proxy,irclib.py,seafile-seahub_settings-template.py --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
# NOTE: for interactive clean up one can use current ignores | |
# E501 Ignore long lines, E402 imports below top, E722 bare except, | |
# F401 unused imports, F502 explicit list in str expand, F841 unused var, | |
# E721 compare type instead of isinstance, W293 blank line with space, | |
# C901 too complex get | |
#flake8 mig --exclude=unittest,grsfs-fuse,vm-proxy,irclib.py,seafile-seahub_settings-template.py --ignore=E501,E402,E722,F401,F502,E713,F841,C901 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
# TODO: prepare and enable pytest | |
#- name: Test with pytest | |
# run: | | |
# pytest | |