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

chore: migrate to pyproject.toml #13

Merged
merged 17 commits into from
Jan 10, 2025
Merged
54 changes: 25 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,35 @@ jobs:
strategy:
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9

steps:
- name: Install Python via conda.
uses: s-weigand/setup-conda@v1
with:
python-version: ${{ matrix.python-version }}
conda-channels: defaults,bioconda,conda-forge
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
lfs: true
- name: Install test dependencies via pip
run: pip install -r requirements/test_black.txt
- name: Run tests
run: pytest
- name: Create text report
run: coverage report
- name: Create XML report for codacy
run: coverage xml
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
- name: Setup conda conda.
uses: conda-incubator/setup-miniconda@v3
with:
conda-channels: conda-forge,bioconda
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
if: ${{ matrix.python-version == '3.7' && (github.ref == 'refs/heads/main') }}
- name: Check style with black
run: black --check --line-length 100 .
if: ${{ matrix.python-version < '3.9' }}
- name: Check style with flake8
run: flake8 .
# Install a specific version of uv and enable caching.
version: "0.5.16"
enable-cache: true

- name: Set up Python
run: uv python install ${{ matrix.python-version }}

- name: Install the project
run: uv sync --all-extras --dev

- name: Run tests
run: uv run pytest

- name: Check formatting
run: uv run ruff format --check

- name: Lint
run: uv run ruff check
7 changes: 3 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ include AUTHORS.rst
include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst
include README.md

graft src

recursive-include tests requirements *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]

recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif

include versioneer.py
recursive-include sodar_cli *.py

include requirements.txt requirements/*.txt
38 changes: 8 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,15 @@
.PHONY: all
all: black
all: format lint pytest

.PHONY: black
black:
black -l 100 .
.PHONY: format
format:
uv run ruff format .

.PHONY: test
test:
black -l 100 --check .
.PHONY: lint
lint:
uv run ruff check .

.PHONY: pytest
pytest:
pytest .
uv run pytest

.PHONY: lint-all
lint-all: bandit pyflakes pep257 prospector

.PHONY: bandit
bandit:
bandit -c bandit.yml -r sodar_cli

.PHONY: pyflakes
pyflakes:
pyflakes sodar_cli tests

.PHONY: pep257
pep257:
pep257

.PHONY: flake8
flake8:
flake8

.PHONY: prospector
prospector:
prospector
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[![Continuous Integration Status](https://github.com/bihealth/sodar-cli/workflows/CI/badge.svg)](https://github.com/bihealth/sodar-cli/actions)

[![image](https://app.codacy.com/project/badge/Grade/0bf5c6d8a91e4a7380676672e466525d)](https://www.codacy.com/gh/bihealth/sodar-cli/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=bihealth/sodar-cli&amp;utm_campaign=Badge_Grade)

[![image](https://app.codacy.com/project/badge/Coverage/0bf5c6d8a91e4a7380676672e466525d)](https://www.codacy.com/gh/bihealth/sodar-cli/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=bihealth/sodar-cli&amp;utm_campaign=Badge_Coverage)

[![image](https://coveralls.io/repos/github/bihealth/sodar-cli/badge.svg?branch=main)](https://coveralls.io/github/bihealth/sodar-cli?branch=main)

[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

# SODAR CLI

Command line interface for [SODAR
Server](https://github.com/bihealth/sodar-server).

## Getting Started

- [SODAR Homepage](https://www.cubi.bihealth.org/software/sodar/)
- [Manual](https://sodar-server.readthedocs.io/en/latest/)

## SODAR Repositories

[sodar-server](https://github.com/bihealth/sodar-server)

: SODAR web server for meta and mass data management.

[sodar-taskflow](https://github.com/bihealth/sodar-taskflow)

: Helper component for running tasks with rollback functionality.

## Installation

``` bash
$ git clone [email protected]:bihealth/sodar-cli.git
$ cd sodar-cli
$ conda create -n sodar-cli python=3.7
$ conda activate sodar-cli
$ pip install -e .
$ cat >~/.sodarrc.toml <<EOF
[global]

# URL to SODAR server.
sodar_server_url = "https://sodar.example.com/"
# API token to use for SODAR API.
sodar_api_token = "XXX"
EOF
```

## Releasing

``` bash
$ $EDITOR HISTORY.rst
$ git tag ...
$ rm -rf dist
$ python setup.py sdist
$ twine upload dist/*.tar.gz
```
66 changes: 0 additions & 66 deletions README.rst

This file was deleted.

5 changes: 0 additions & 5 deletions bandit.yml

This file was deleted.

18 changes: 12 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
master_doc = "index"

# General information about the project.
project = u"SODAR CLI"
copyright = u"2020-2021 CUBI - Core Unit Bioinformatics, Berlin Institute of Health"
author = u"Manuel Holtgrewe"
project = "SODAR CLI"
copyright = "2020-2021 CUBI - Core Unit Bioinformatics, Berlin Institute of Health"
author = "Manuel Holtgrewe"

# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
Expand Down Expand Up @@ -133,15 +133,21 @@
# (source start file, target name, title, author, documentclass
# [howto, manual, or own class]).
latex_documents = [
(master_doc, "sodar_cli.tex", u"SODAR CLI Documentation", u"Core Unit Bioinformatics", "manual")
(
master_doc,
"sodar_cli.tex",
"SODAR CLI Documentation",
"Core Unit Bioinformatics",
"manual",
)
]


# -- Options for manual page output ------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "sodar_cli", u"SODAR CLI Documentation", [author], 1)]
man_pages = [(master_doc, "sodar_cli", "SODAR CLI Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------
Expand All @@ -153,7 +159,7 @@
(
master_doc,
"sodar_cli",
u"SODAR CLI Documentation",
"SODAR CLI Documentation",
author,
"sodar_cli",
"One line description of project.",
Expand Down
Loading
Loading