Skip to content

Commit

Permalink
Switch from setup.py to pyproject.toml and poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
cokelaer committed Aug 4, 2023
1 parent aa706c6 commit 6329cfa
Show file tree
Hide file tree
Showing 12 changed files with 4,176 additions and 97 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@ jobs:
- name: Install dependencies
run: |
pip install coveralls pytest-cov
pip install -r requirements_dev.txt
- name: install package itself
run: |
pip install .
pip install sequana_fastqc
pip install poetry
poetry install
- name: testing
run: |
pytest --cov-report term --cov=sequana_pipetools
poetry run pytest --cov-report term --cov=sequana_pipetools
- name: coveralls
run: |
echo $COVERALLS_REPO_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ doc/_build
*.egg-info/
.installed.cfg
*.egg

poetry.lock

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ Changelog
========= ======================================================================
Version Description
========= ======================================================================
0.13.0 * switch to pyproject and fixes #64
0.12.5 * automatically populater 'wrappers' in PipelineManager' based on the
config entry 'sequana_wrappers'.
0.12.4 * handles sequana pipeline with underscores (e.g. pacbio_qc)
Expand Down
4,096 changes: 4,096 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"


#maintainer ?#maintainer email
[tool.poetry]
name = "sequana_pipetools"
version = "0.13.0"
description = "A set of tools to help building or using Sequana pipelines"
authors = ["Sequana Team"]
license = "BSD-3"
repository = "https://github.com/sequana/sequana_pipetools"
readme = "README.rst"
keywords = ["snakemake", "sequana", "pipelines"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Information Analysis",
]
packages = [
{ include = "sequana_pipetools" }
]

[tool.poetry.dependencies]
python = ">=3.8"
deprecated = ">=1.2.13"
easydev = ">=0.12.1"
parse = ">=1.19.0"
"ruamel.yaml" = ">=0.17.32"
packaging = ">=23.1"
pykwalify = ">=1.8"
importlib_resources = ">=5.4.0"
pyyaml = ">=1.3"
aiohttp = ">=3.8.4"
tqdm = ">=4.65"
charset-normalizer = "^2"


[tool.poetry.scripts]
sequana_completion = "sequana_pipetools.scripts.completion:main"
sequana_slurm_status = "sequana_pipetools.scripts.slurm:main"


[tool.poetry.group.dev.dependencies]
black = "^23.7.0"
pytest = "^7.4.0"
mock = "^5.1.0"
pytest-mock = "^3.11.1"
sequana-fastqc = "^1.7.1"
pytest-cov = "^4.1.0"

10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements_dev.txt

This file was deleted.

4 changes: 3 additions & 1 deletion sequana_pipetools/snaketools/file_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ def _pathname(self):
pathname = set(self.pathnames)
if len(pathname) == 1:
return list(pathname)[0] + os.sep
elif len(pathname) == 0:
raise ValueError(f"found no pathname; no input files found in {self.patten} ?")
else:
raise ValueError("found more than one pathname")
raise ValueError(f"found more than one pathname {pathname}.")

pathname = property(_pathname, doc="the common relative path")

Expand Down
68 changes: 0 additions & 68 deletions setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions tests/snaketools/test_filefactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def inner_test(ff):
ff.extensions

# list
list_files = glob.glob("*.py")
list_files = glob.glob("*.*")
ff = snaketools.FileFactory(list_files)
inner_test(ff)

# glob
ff = snaketools.FileFactory("*py")
ff = snaketools.FileFactory("*.*")
inner_test(ff)

ff = snaketools.FastQFactory(test_dir + "/data/Hm2*fastq.gz", verbose=True)
Expand Down
15 changes: 8 additions & 7 deletions tests/snaketools/test_sequana_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ def test_sequana_config(tmpdir):
# test all installed pipelines saving/reading config file
output = tmpdir.join("test.yml")
for pipeline in snaketools.pipeline_names:
config_filename = Module(pipeline)._get_config()
cfg1 = SequanaConfig(config_filename)

cfg1.save(output)
cfg2 = SequanaConfig(str(output))
assert cfg2._yaml_code == cfg1._yaml_code
assert cfg1.config == cfg2.config
if "_fastqc" in pipeline:
config_filename = Module(pipeline)._get_config()
cfg1 = SequanaConfig(config_filename)

cfg1.save(output)
cfg2 = SequanaConfig(str(output))
assert cfg2._yaml_code == cfg1._yaml_code
assert cfg1.config == cfg2.config

# test config with a _directory or _file based on the fastqc pipeline
cfg = SequanaConfig(s.config)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def test_copy_requirements(tmpdir):
requirements = [
# "phiX174.fa",
str(tmp_require),
"https://raw.githubusercontent.com/sequana/sequana/master/README.rst",
"https://raw.githubusercontent.com/sequana/sequana/main/README.rst",
"__init__.py",
"setup.py",
]
Expand Down

0 comments on commit 6329cfa

Please sign in to comment.