Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
99 changes: 99 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Publish PANORAMA to PyPI
#
# - On a GitHub release: automatically publish to PyPI
# - Manually: optionally publish to TestPyPI and/or PyPI

name: Publish Python Package

on:
release:
types: [released]

workflow_dispatch:
inputs:
publish_test:
description: "Publish to TestPyPI"
required: true
type: boolean
default: false
publish_to_pypi:
description: "Publish to PyPI"
required: true
type: boolean
default: false

permissions:
contents: read

jobs:
release-build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build release distributions
run: |
python -m pip install --upgrade build
python -m build

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

pypi-publish-test:
runs-on: ubuntu-latest
needs: release-build
if: github.event_name == 'workflow_dispatch' && inputs.publish_test == true

permissions:
id-token: write

environment:
name: testpypi
url: https://test.pypi.org/project/panorama-sys/
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

pypi-publish:
runs-on: ubuntu-latest
needs: release-build

if: >-
(github.event_name == 'release' && github.event.action == 'released') ||
(github.event_name == 'workflow_dispatch' && inputs.publish_to_pypi == true)

permissions:
id-token: write

environment:
name: pypi
url: https://pypi.org/project/panorama-sys/

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[![GitHub issues](https://img.shields.io/github/issues/labgem/panorama.svg?style=flat-square&maxAge=600)](https://github.com/labgem/panorama/issues)
[![Docs](https://img.shields.io/readthedocs/panorama/latest?style=flat-square&maxAge=600)](https://panorama.readthedocs.io)
[![Downloads](https://anaconda.org/bioconda/panorama/badges/downloads.svg)](https://bioconda.github.io/recipes/panorama/README.html#download-stats)
[![PyPI version](https://badge.fury.io/py/panorama-sys.svg?cache-control=no-cache)](https://pypi.org/project/panorama-sys/)
[![Paper](https://img.shields.io/badge/paper-PLOS%20Computational%20Biology-teal.svg?style=flat-square&maxAge=3600)](https://doi.org/10.1371/journal.pcbi.1013856)
[![Citations](https://img.shields.io/badge/dynamic/regex?url=https%3A%2F%2Fbadge.dimensions.ai%2Fdetails%2Fdoi%2F10.1371%2Fjournal.pcbi.1013856&search=%3Cdiv%20class%3D%22count%22%3E(%5Cd*)%3C%2Fdiv%3E&replace=%241&style=flat-square&label=citations&cacheSeconds=3600)](https://badge.dimensions.ai/details/doi/10.1371/journal.pcbi.1013856)

Expand All @@ -23,20 +24,28 @@ software suite. It is designed to perform pangenome comparison at high-throughtu

# Quick Installation

PANORAMA is easily installed with [conda](https://docs.conda.io/projects/conda/en/latest/index.html) and
[pip](https://pip.pypa.io/en/stable/). Follow the next step to install panorama.
The recommended installation method is via [Conda](https://docs.conda.io/projects/conda/en/latest/index.html) from the [Bioconda](https://bioconda.github.io/) channel.
A PyPI installation is also available as an alternative when you prefer `pip`.

## Install with Bioconda

```shell
# 1. Clone the Repository
git clone https://github.com/labgem/PANORAMA.git
cd PANORAMA

# 2. Create and Configure the Conda Environment
conda create -n panorama
conda config --add channels bioconda
conda config --add channels conda-forge
conda create -n panorama -c conda-forge -c bioconda panorama
conda activate panorama
conda env update --file panorama.yml
panorama --version
```

## Install with PyPI

The package published on PyPI is named `panorama-sys`.

```shell
pip install panorama-sys
panorama --version
```

```{warning}
The PyPI release only includes the Python package and Python dependencies. Non-Python system requirements such as MMSeqs2 and geckodriver must be installed separately before using the full feature set.
```

[//]: # (You can find more information on the installation [here](link_read_the_doc))
Expand Down
15 changes: 14 additions & 1 deletion docs/user/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,23 @@ To use a specific python version:
conda create -n panorama -c conda-forge -c bioconda panorama python=X.X
```

---
### Installation via PyPI

An alternative install option is the PyPI package, named `panorama-sys`.

```shell
pip install panorama-sys
panorama --version
```

```{warning}
The PyPI package includes only the Python package and Python dependencies. It does not ship non-Python system requirements, such as MMSeqs2, geckodriver, or other OS-level tools that PANORAMA may need. Install those separately with your system package manager or Conda before using the full feature set.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include the command or a link to the packages ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have this section https://panorama.readthedocs.io/latest/user/install.html#install-panorama-dependencies.

That might be good to refer to it and maybe update it.

```

### Installing from source code (GitHub)

This installation method is intended for developers or advanced users. For normal users, we recommend the Bioconda package or the PyPI package.

(with_conda_env)=

#### Within a Conda environment
Expand Down
4 changes: 2 additions & 2 deletions panorama/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
)

import argparse
from importlib.metadata import distribution

from panorama.alignment.align import launch as align_launcher
from panorama.alignment.align import subparser as align_subparser
Expand Down Expand Up @@ -52,12 +51,13 @@
from panorama.utils import (
RawTextArgumentDefaultsHelpFormatter,
add_common_arguments,
get_panorama_version,
set_verbosity_level,
)
from panorama.workflow.pansystems import launch as pansystems_launcher
from panorama.workflow.pansystems import subparser as pansystems_subparser

version = distribution("panorama").version
version = get_panorama_version()
opening = r"""
____ ___ _ __ ____ ____ ___ __ ___ ___
/ __ \ / | / | / / / __ \ / __ \ / | / |/ / / |
Expand Down
11 changes: 10 additions & 1 deletion panorama/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,16 @@ def set_verbosity_level(args: argparse.Namespace) -> None:
# log is written in a files. basic condif uses filename
logging.basicConfig(filename=args.log, level=level, format=str_format, datefmt=datefmt)
logging.getLogger("PANORAMA").debug("Command: " + " ".join([arg for arg in sys.argv]))
logging.getLogger("PANORAMA").debug(f"PANORAMA version: {distribution('panorama').version}")
logging.getLogger("PANORAMA").debug(f"PANORAMA version: {get_panorama_version()}")


def get_panorama_version() -> str:
"""
Get the version of the panorama package.

:return: The version of the panorama package.
"""
return distribution("panorama-sys").version


# File managing system
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "PANORAMA"
name = "panorama-sys"

authors = [
{ name = "Jérôme Arnoux", email = "arnoux.jeromepj@gmail.com" },
Expand Down
Loading