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

Update pyEnsemblRest #20

Merged
merged 11 commits into from
Nov 22, 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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @gawbul
64 changes: 64 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: pull_request

on:
pull_request:
paths:
- 'pyensemblrest/**.py'

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
environment: dev
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set Poetry Version
id: set-poetry-version
run: echo "POETRY_VERSION=$(cat .poetry-version)" >> $GITHUB_OUTPUT

- name: Install Poetry
id: install-poetry-version
uses: snok/install-poetry@v1
with:
version: ${{ steps.set-poetry-version.outputs.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install project
run: poetry install --no-interaction

- name: Run pre-commit hooks, excluding unit tests
run: SKIP=unit-test poetry run pre-commit run --all-files

- name: Run unit tests with pytest and code coverage with pytest-cov
run: poetry run pytest -v --cov=pyensemblrest --cov-report lcov:./tests/lcov.info

- name: Upload Coverage Results
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./tests/lcov.info
86 changes: 86 additions & 0 deletions .github/workflows/push_tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: push_tag

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

permissions:
contents: read

jobs:
release:
name: Release to GitHub
runs-on: ubuntu-latest
environment: dev
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ">=3.10 <3.13"

- name: Set Poetry Version
id: set-poetry-version
run: echo "POETRY_VERSION=$(cat .poetry-version)" >> $GITHUB_OUTPUT

- name: Install Poetry
id: install-poetry-version
uses: snok/install-poetry@v1
with:
version: ${{ steps.set-poetry-version.outputs.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install project
run: poetry install --no-interaction

- name: Build project
run: poetry build

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

- name: Create release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*
publish:
needs:
- release
permissions:
id-token: write
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: dev
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish project
run: poetry publish
env:
POETRY_PYPI_TOKEN_PYENSEMBLREST: ${{ secrets.POETRY_PYPI_TOKEN_PYENSEMBLREST }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
lcov.info

# Translations
*.mo
Expand All @@ -63,3 +64,12 @@ target/
.spyderproject
cover/
.spyproject/

# Ruff
.ruff_cache/

# Mypy
.mypy_cache/

# Pytest
.pytest_cache/
1 change: 1 addition & 0 deletions .poetry-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8.4
53 changes: 53 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: no-commit-to-branch
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
hooks:
- id: ruff
name: ruff
description: "Run 'ruff' for extremely fast Python linting"
entry: ruff check --force-exclude
language: python
types_or: [python, pyi, jupyter]
args: []
require_serial: true
additional_dependencies: []
minimum_pre_commit_version: "2.9.2"
- id: ruff-format
name: ruff-format
description: "Run 'ruff format' for extremely fast Python formatting"
entry: ruff format --force-exclude
language: python
types_or: [python, pyi, jupyter]
args: []
require_serial: true
additional_dependencies: []
minimum_pre_commit_version: "2.9.2"
- repo: local
hooks:
- id: poetry-check
name: poetry-check
entry: poetry check --quiet
language: system
pass_filenames: false
files: ^(.*/)?pyproject\.toml$
- id: mypy
name: mypy
entry: poetry run mypy
language: system
types: [python]
require_serial: true
exclude: ^(tests/|examples.py)
- id: unit-test
name: unit-test
entry: make unit-test
language: system
types: [file]
pass_filenames: false
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.0] - 2024-11-22

### Added

- Various new endpoints to bring up to Ensembl REST release 15.8

### Fixed

- Fixed existing endpoints and unit tests as well as various bugs

### Changed

- Moved to Python 3.10+

### Removed

- Removed deprecated Ensembl endpoints
Loading
Loading