Skip to content

Commit

Permalink
Merge pull request #882 from kedhammar/ci
Browse files Browse the repository at this point in the history
CI pt. 1: Configuration
  • Loading branch information
kedhammar authored Oct 23, 2024
2 parents f095dd6 + 75694e1 commit 21e4014
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 20 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint code
on: [push, pull_request]

jobs:
# Use ruff to check for code style violations
ruff-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: ruff --> Check for style violations
# Configured in pyproject.toml
run: ruff check .

# Use ruff to check code formatting
ruff-format:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: ruff --> Check code formatting
run: ruff format --check .
23 changes: 13 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
d3/
jquery/
__pycache__/
.DS_Store
.ruff_cache/
.vscode/
*.orig
*.pyc
*.swp
*~
build/
d3/
dist/
status.egg-info/
run_dir/settings.yaml
tests/test_items.yaml
.DS_Store
run_dir/qc_reports/
jquery/
Pipfile
Pipfile.lock
run_dir/settings/
*.swp
*.orig
run_dir/genosqlrc.yaml
run_dir/qc_reports/
run_dir/settings.yaml
run_dir/settings/
status.egg-info/
tests/test_items.yaml
18 changes: 11 additions & 7 deletions conda_requirements.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
channels:
- conda-forge
dependencies:
- python=3.12
- 'conda-forge::pango>=1.42.0'
- 'conda-forge::pandas>=1.3.2'
- conda-forge::psycopg2
- conda-forge::open-fonts
- conda-forge::xorg-libxrender
- conda-forge::xorg-libxext
- conda-forge::xorg-libxau
- pango>=1.42.0
- pandas>=1.3.2
- psycopg2
- open-fonts
- xorg-libxrender
- xorg-libxext
- xorg-libxau
- pip:
- '-r requirements.txt'
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# === LINTING ================================================================

[tool.ruff.lint]
select = [
# Ruff default rules
# ------------------------------
"E4", # pycodestyle Imports
"E7", # pycodestyle Statements
"E9", # pycodestyle Runtime
"F", # Pyflakes

# Additional Comment
# ------------------------------------------------------
"I", # isort Best-practice sorting of imports
"UP", # pyupgrade Make sure syntax is up-to-date
]
ignore = [
"E402", # Module level import not at top of file
"E722", # Do not use bare 'except'
"E741", # Ambiguous variable name
]
8 changes: 5 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
atlassian-python-api
backports.ssl-match-hostname>=3.5.0.1
cffi
CouchDB==1.1
ecdsa>=0.13
genologics @ git+https://github.com/SciLifeLab/genologics.git
genologics_sql @ git+https://github.com/SciLifeLab/genologics_sql.git
httplib2>=0.10.3
ibmcloudant>=0.9.1
cffi
matplotlib>=2.0.0
markdown
matplotlib>=2.0.0
nest_asyncio
numpy>=1.12.1
oauth2>=1.9.0.post1
openpyxl
atlassian-python-api
pycryptodome>=3.6.1
pyparsing>=2.2.0
python-dateutil>=2.7.5
pytz>=2018.9
PyYAML
requests>=2.14.2
selenium
setuptools
simplejson>=3.10.0
six>=1.10.0
slack_sdk
Expand Down
2 changes: 2 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
ipdb
ruff
selenium

0 comments on commit 21e4014

Please sign in to comment.