Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge: merge latest changes from upstream/main and resolve conflicts #3

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 14 additions & 36 deletions .ebextensions/01_download_data.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,24 @@ commands:
command: "yum install -y python-devel postgresql-devel"
02_install_aws_cli:
command: "yum install -y awscli"
03_install_unzip:
command: "yum install -y unzip"
04_eb_packages:
03_eb_packages:
command: "/var/app/venv/staging-LQM1lest/bin/pip install uvloop websockets httptools typing-extensions"
05_export_eb_env_var:
04_export_eb_env_var:
command: "export $(cat /opt/elasticbeanstalk/deployment/env | xargs)"

container_commands:
01_uta_permissions:
test: test -d "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/uta_tools"
command: "chmod -R 777 /var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/uta_tools/data"
01_s3_download:
test: test ! -d "/usr/local/share/seqrepo/2024-02-20"
command: "aws s3 cp s3://${AWS_BUCKET_NAME}/${AWS_SEQREPO_OBJECT} /usr/local/share/seqrepo.tar.gz --region us-east-2"

02_s3_download:
test: test ! -d "/usr/local/share/seqrepo"
command: "aws s3 cp s3://${AWS_BUCKET_NAME}/${AWS_SEQREPO_OBJECT} /usr/local/share/seqrepo.zip --region us-east-2"
02_extract_seqrepo:
test: test -f "/usr/local/share/seqrepo.tar.gz"
command: "mkdir -p /usr/local/share/seqrepo/2024-02-20 && tar -xzvf /usr/local/share/seqrepo.tar.gz -C /usr/local/share/seqrepo/2024-02-20"

03_unzip_seqrepo:
test: test -f "/usr/local/share/seqrepo.zip"
command: "unzip /usr/local/share/seqrepo.zip -d /usr/local/share"
03_seqrepo_zip_permission:
test: test -f "/usr/local/share/seqrepo.tar.gz"
command: "chmod +wr /usr/local/share/seqrepo.tar.gz"

04_seqrepo_permission:
test: test -d "/usr/local/share/seqrepo"
command: "chmod -R 777 /usr/local/share/seqrepo"

05_macosx_permission:
test: test -d "/usr/local/share/__MACOSX"
command: "chmod -R +wr /usr/local/share/__MACOSX"

06_seqrepo_zip_permission:
test: test -f "/usr/local/share/seqrepo.zip"
command: "chmod +wr /usr/local/share/seqrepo.zip"

07_remove_macosx:
test: test -d "/usr/local/share/__MACOSX"
command: "rm -R /usr/local/share/__MACOSX"

08_remove_seqrepo_zip:
test: test -f "/usr/local/share/seqrepo.zip"
command: "rm /usr/local/share/seqrepo.zip"

9_data_permission:
test: test -d "/usr/local/share/seqrepo"
command: "chmod -R +wrx /usr/local/share/seqrepo"
04_remove_seqrepo_zip:
test: test -f "/usr/local/share/seqrepo.tar.gz"
command: "rm /usr/local/share/seqrepo.tar.gz"
12 changes: 12 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[flake8]
ignore = E129,E133,E203,E221,E241,E251,E303,E266,H106,H904,W291
max-line-length = 100
max-complexity = 15
hang-closing = true
exclude =
.eggs
.tox
build
dist
docs/conf.py
tests/*
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# .git-blame-ignore-revs
# Initial formatting with Ruff
2b56cd434a129fe0ab1311f7fe9a65767ed88b9e
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @GenomicMedLab/wagner-lab-developers
3 changes: 3 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# file must contain an array, which may be empty

[]
48 changes: 48 additions & 0 deletions .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# https://josephrodriguezg.medium.com/build-and-publish-docker-images-with-github-actions


name: Build and publish a Docker image
on:
push:
branches:
- 'main'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
jobs:
build:
name: Build & push docker image
runs-on: ubuntu-latest
env:
IMG_NAME: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Debug
run: |
echo "github.ref -> {{ github.ref }}"

- name: Docker metadata
id: metadata
uses: docker/metadata-action@v3
with:
images: ${{ env.IMG_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value={{sha}},enable=${{ github.ref_type != 'tag' }}
- name: Log in to Docker Hub
uses: docker/login-action@v1
if: ${{ github.ref_type == 'tag' }}
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event.base_ref =='refs/heads/main' && github.ref_type == 'tag' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
29 changes: 29 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Sync labels
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- '.github/labels.yml'
- '.github/workflows/labels.yml'

permissions:
issues: write

jobs:
labels:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
sparse-checkout: .github/labels.yml

- uses: EndBug/label-sync@v2
with:
config-file: |
https://raw.githubusercontent.com/biocommons/.github/main/etc/labels.yml
.github/labels.yml

delete-other-labels: false
68 changes: 68 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Python package

on:
push:

jobs:
cqa:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: zsh
version: 1.0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache-dependency-path: '**/pyproject.yaml'

- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install --use-deprecated=legacy-resolver -e '.[dev]'

- name: Lint with Ruff
run: |
ruff check .

- name: Format check with Ruff
run: |
ruff format --check .

test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4

- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: zsh
version: 1.0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: '**/pyproject.yaml'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
make develop

- name: Test with pytest
run: |
make test
23 changes: 5 additions & 18 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
name: Mark stale issues and pull requests
# https://github.com/actions/stale

name: 'Close stale issues and PRs'
on:
workflow_dispatch:
schedule:
- cron: "30 1 * * *"
- cron: '1 1 * * *'

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-label: Stale
stale-issue-message: >-
This issue was marked stale due to inactivity.
stale-pr-label: Stale
stale-pr-message: >-
This pull request was marked stale due to inactivity.
days-before-stale: 60
days-before-close: 14
exempt-issue-labels: "Stayin' Alive"
uses: biocommons/.github/.github/workflows/stale.yml@main
120 changes: 17 additions & 103 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,108 +1,22 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.bak
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.egg-info
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# PyCharm
.idea

*~
*.bak
*.manifest
*.orig
doc/_build
*.sqlite3
*~
.cache
.coverage
.eggs
archive
misc/docker
.pytest_cache

doc/changelog/*/.tags
doc/changelog/*/.tags.mk
doc/changelog/*/hg-git-remap.pl
.idea
.ipynb_checkpoints
.tox
.vscode
web_*
refget-compliance-suite/
__pycache__
archive
build
dist
docs/_build
nosetests.xml
venv
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
- id: ruff-format
args: [ --check ]

Loading
Loading