Skip to content

Commit

Permalink
Merge pull request #16 from EBI-Metagenomics/feature/bioconda_package
Browse files Browse the repository at this point in the history
Prepared repo for publication as bioconda package
  • Loading branch information
Ge94 authored Apr 30, 2024
2 parents 07361ac + 6c6e300 commit 2520f28
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 32 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/publish_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Upload Python Package

on:
release:
types: [published]

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/genomeuploader
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
75 changes: 75 additions & 0 deletions .github/workflows/pytest_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Run pytest

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
pytest_38:
name: Run pytest 3.8
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: pip install .[test]
- uses: pavelzw/pytest-action@v2
env:
ENA_WEBIN: ${{ secrets.ENA_WEBIN }}
ENA_WEBIN_PASSWORD: ${{ secrets.ENA_WEBIN_PASSWORD }}
with:
emoji: false
verbose: true
job-summary: true

pytest_39:
name: Run pytest 3.9
needs:
- pytest_38
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
run: pip install .[test]
- uses: pavelzw/pytest-action@v2
env:
ENA_WEBIN: ${{ secrets.ENA_WEBIN }}
ENA_WEBIN_PASSWORD: ${{ secrets.ENA_WEBIN_PASSWORD }}
with:
emoji: false
verbose: true
job-summary: true

pytest_310:
name: Run pytest 3.10
needs:
- pytest_39
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: pip install .[test]
- uses: pavelzw/pytest-action@v2
env:
ENA_WEBIN: ${{ secrets.ENA_WEBIN }}
ENA_WEBIN_PASSWORD: ${{ secrets.ENA_WEBIN_PASSWORD }}
with:
emoji: false
verbose: true
job-summary: true
24 changes: 0 additions & 24 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion genomeuploader/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.0"
__version__ = '2.1.0'
15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[project]
name = "genomeuploader"
name = "genome_uploader"
version = "2.1.0"
readme = "README.md"
authors = [
{name = "MGnify team", email = "[email protected]"},
]
license = {text = "Apache Software License 2.0"}
keywords = ["bioinformatics", "tool", "metagenomics"]
dynamic = ["version"]
description = "Python script to upload bins and MAGs in fasta format to ENA (European Nucleotide Archive). This script generates xmls and manifests necessary for submission with webin-cli."
requires-python = ">=3.8"
classifiers = [
Expand All @@ -26,6 +26,10 @@ dependencies = [
"python-dotenv==1.0.1"
]

[project.urls]
Homepage = "https://github.com/EBI-Metagenomics/genome_uploader"
Issues = "https://github.com/EBI-Metagenomics/genome_uploader/issues"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q"
Expand All @@ -43,7 +47,9 @@ dev = [
"bump-my-version==0.9.2",
]
test = [
"pytest==7.1.2",
"pytest==7.4.0",
"pytest-md==0.2.0",
"pytest-workflow==2.0.1",
"pytest-cov==3.0.0",
]

Expand All @@ -54,9 +60,6 @@ build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["genomeuploader"]

[tool.setuptools.dynamic]
version = {attr = "genomeuploader.__version__"}

[project.scripts]
genome_upload = "genomeuploader.genome_upload:main"

Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[pytest]
python_files = tests/*.py
pythonpath = .
testpaths = tests

0 comments on commit 2520f28

Please sign in to comment.