Skip to content

Commit b783ade

Browse files
author
Roberto Vera Alvarez
committed
Updating to Poetry
1 parent 77e9f4f commit b783ade

File tree

10 files changed

+113
-223
lines changed

10 files changed

+113
-223
lines changed

.github/workflows/python-app.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,24 @@ name: Python application
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: ["**"]
99
pull_request:
10-
branches: [ master ]
10+
branches: ["**"]
1111

1212
jobs:
1313
build:
1414

1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
19-
- name: Set up Python 3.9
20-
uses: actions/setup-python@v2
18+
- uses: actions/checkout@v4
19+
- name: Set up Python 3.12
20+
uses: actions/setup-python@v5
2121
with:
22-
python-version: 3.9
22+
python-version: 3.12
23+
- name: Install Poetry
24+
run: pip install poetry tox
2325
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install flake8
27-
if [ -f requirements/test.txt ]; then pip install -r requirements/test.txt; fi
28-
- name: Lint with flake8
29-
run: |
30-
flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics
31-
flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
32-
- name: Test with pytest
33-
run: |
34-
python setup.py install
35-
pytest
26+
run: poetry install
27+
- name: Test with tox
28+
run: poetry run tox

.github/workflows/python-package.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
1+
# This workflows will upload a Python Package using Poetry when a release is created
22
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
33

44
name: Upload Python Package
@@ -14,19 +14,16 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1818
- name: Set up Python
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: '3.x'
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install setuptools wheel twine
22+
- name: Install Poetry
23+
run: pip install poetry
2624
- name: Build and publish
2725
env:
28-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
29-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
26+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
3027
run: |
31-
python setup.py sdist bdist_wheel
32-
twine upload dist/*
28+
poetry build
29+
poetry publish

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python:
2-
version: 3.7
2+
version: 3.12
33
pip_install: true
44
install:
55
- requirements: docs/requirements.txt

pyproject.toml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[build-system]
2+
requires = ["poetry-core>=1.0.0"]
3+
build-backend = "poetry.core.masonry.api"
4+
5+
[tool.poetry]
6+
name = "pm4ngs"
7+
version = "0.0.0" # Replace with the correct version or use a plugin for scm
8+
description = "PM4NGS generates a standard organizational structure for Next Generation Sequencing (ngs) data analysis"
9+
license = "Public Domain"
10+
authors = ["Vera Alvarez, Roberto <[email protected]>"]
11+
maintainers = ["Vera Alvarez, Roberto <[email protected]>"]
12+
readme = "README.md"
13+
homepage = "https://github.com/ncbi/pm4ngs"
14+
repository = "https://github.com/ncbi/pm4ngs"
15+
documentation = "https://pm4ngs.readthedocs.io/"
16+
keywords = ["Biocontainers", "Bioinformatics", "NGS", "Genomics"]
17+
18+
classifiers = [
19+
"Development Status :: 3 - Alpha",
20+
"Intended Audience :: Science/Research",
21+
"License :: Public Domain",
22+
"Natural Language :: English",
23+
"Operating System :: Unix",
24+
"Programming Language :: Python :: 3",
25+
"Programming Language :: Python :: 3.9",
26+
"Programming Language :: Python :: 3.10",
27+
"Programming Language :: Python :: 3.11",
28+
"Programming Language :: Python :: 3.12",
29+
"Topic :: Scientific/Engineering :: Bio-Informatics",
30+
]
31+
32+
packages = [
33+
{ include = "pm4ngs", from = "src" },
34+
]
35+
36+
[tool.poetry.dependencies]
37+
python = ">=3.7,<4.0"
38+
docutils = "*"
39+
bioconda2biocontainer = "*"
40+
biopython = "*"
41+
cookiecutter = "*"
42+
cwltool = "*"
43+
docker = "*"
44+
galaxy-tool-util = "*"
45+
GitPython = "*"
46+
goenrichment = "*"
47+
jupyter = "*"
48+
matplotlib = "*"
49+
networkx = "*"
50+
numpy = "*"
51+
pandas = "*"
52+
pdf2image = "*"
53+
PyYAML = "*"
54+
requests = "*"
55+
scipy = "*"
56+
seaborn = "*"
57+
statsmodels = "*"
58+
urllib3 = "*"
59+
xmltodict = "*"
60+
61+
[tool.poetry.group.dev.dependencies]
62+
pytest = "*"
63+
pytest-cov = "*"
64+
flake8 = "*"
65+
66+
67+
[tool.poetry.scripts]
68+
pm4ngs-server = "pm4ngs.main:start_server_main"
69+
pm4ngs-create = "pm4ngs.main:create_project"
70+
pm4ngs-rnaseq = "pm4ngs.main:rnaseq"
71+
pm4ngs-rnaseq-demo = "pm4ngs.main:rnaseq_demo"
72+
pm4ngs-chipseq = "pm4ngs.main:chipseq"
73+
pm4ngs-chipseq-demo = "pm4ngs.main:chipseq_demo"
74+
pm4ngs-chipexo = "pm4ngs.main:chipexo"
75+
pm4ngs-chipexo-demo = "pm4ngs.main:chipexo_demo"
76+
pm4ngs-transcriptome-annotation = "pm4ngs.main:transcriptome_annotation"
77+
pm4ngs-transcriptome-annotation-demo = "pm4ngs.main:transcriptome_annotation_demo"
78+
79+
[tool.poetry.urls]
80+
Tracker = "https://github.com/ncbi/pm4ngs/issues"
81+
82+
[tool.poetry-dynamic-versioning]
83+
enable = true
84+
vcs = "git"
85+
style = "semver"

requirements/base.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

requirements/test.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 86 deletions
This file was deleted.

src/pm4ngs/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
from pkg_resources import DistributionNotFound
2-
3-
try:
4-
_distribution = __import__('pkg_resources').get_distribution("pm4ngs")
5-
except DistributionNotFound: # Likely, running from working dir without installed dist
6-
__version__ = 'SNAPSHOT'
7-
else:
8-
__version__ = _distribution.version if _distribution else 'SNAPSHOT'

tox.ini

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,19 @@
1-
; Tox configuration file - http://tox.readthedocs.io/en/latest/config.html
21
[tox]
3-
envlist = py{37,38,39},flake8
2+
envlist = py{39,310,311,312},flake8
43

54

65
[testenv]
7-
; Configuration to put in all test environments (unless overridden)
8-
;
9-
; Install pm4ngs, its test dependencies, and
10-
; teamcity-messages (so it can tell TC which tests passed).
11-
12-
deps =
13-
-rrequirements/test.txt
14-
15-
; Coverage options are not in `addopts` because PyCharm doesn't stop on breakpoints inside tests
16-
commands = py.test {posargs:--cov pm4ngs --cov tests --cov-report term-missing --cov-report html --cov-report xml:coverage.xml}
17-
18-
; usedevelop: if true, use `setup.py develop` to install pm4ngs
19-
; inside Tox's test environment. If false, use `setup.py install`.
20-
;
21-
; Set `usedevelop = True` if you want your tests to run faster.
22-
;
23-
; Set `usedevelop = False` if your tests rely on data files or executable
24-
; binaries being installed correctly, or if your package is a namespace package
25-
; (like ncbi.*) AND it uses another package in the same namespace.
26-
usedevelop = True
27-
28-
; If your application needs some external configuration values in environment
29-
; variables, uncomment these lines and list the variables here, separated by
30-
; whitespace, wildcards work:
31-
;passenv =
32-
; MY_DATABASE_URL
6+
skip_install = true
7+
allowlist_externals = poetry
8+
commands_pre = poetry install
9+
commands = poetry run pytest {posargs:--cov bioconda2biocontainer --cov tests --cov-report term-missing --cov-report html --cov-report xml:coverage.xml}
3310

3411

3512
[testenv:flake8]
36-
; Flake8 test environment, don't install the package or its deps, instead just
37-
; install & run flake8.
38-
3913
skip_install = True
40-
deps = flake8
41-
commands = flake8 src/ tests/
42-
43-
; This should correspond to the lowest Python interpreter version supported by the package
44-
basepython = python3.7
14+
allowlist_externals = poetry
15+
commands_pre = poetry install --no-root
16+
commands = poetry run flake8 src/
4517

4618

4719
[pytest]

0 commit comments

Comments
 (0)