diff --git a/.vscode/launch.json b/.vscode/launch.json index 308d5b0..fd2e135 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,10 +6,10 @@ "configurations": [ { - "name": "automlst info -lschema pubmlst_bordetella_seqdef", + "name": "autobigsst info -lschema pubmlst_bordetella_seqdef", "type": "debugpy", "request": "launch", - "program": "${workspaceFolder}/src/automlst/cli/program.py", + "program": "${workspaceFolder}/src/autobigsst/cli/program.py", "console": "integratedTerminal", "args": [ "info", diff --git a/Jenkinsfile b/Jenkinsfile index 8b32ac6..58effaa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,7 +26,8 @@ pipeline { } steps { sh "python -m build" - sh "conda-build automlst.engine --output-folder conda-bld" + sh "grayskull pypi dist/*.tar.gz" + sh "conda-build autobigsst.engine --output-folder conda-bld" } } stage("archive") { @@ -38,10 +39,10 @@ pipeline { parallel { stage ("internal") { environment { - TOKEN = credentials('git.reslate.systems') + CREDS = credentials('username-password-rs-git') } steps { - sh returnStatus: true, script: 'python -m twine upload --repository-url https://git.reslate.systems/api/packages/ydeng/pypi -u __token__ -p ${TOKEN} --non-interactive --disable-progress-bar --verbose dist/*' + sh returnStatus: true, script: 'python -m twine upload --repository-url https://git.reslate.systems/api/packages/ydeng/pypi -u ${CREDS_USR} -p ${CREDS__PSW} --non-interactive --disable-progress-bar --verbose dist/*' } } stage ("external") { @@ -50,7 +51,6 @@ pipeline { } environment { PYPI_TOKEN = credentials('pypi.org') - CONDA_TOKEN = credentials('anaconda.org') } steps { sh returnStatus: true, script: 'python -m twine upload -u __token__ -p ${TOKEN} --non-interactive --disable-progress-bar --verbose dist/*' diff --git a/README.md b/README.md index 0116c2f..dd8d1e6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# autoMLST.Engine +# autobigsst.Engine A python library implementing common BIGSdb MLST schemes and databases. Implementation follows the RESTful API outlined by the official [BIGSdb documentation](https://bigsdb.readthedocs.io/en/latest/rest.html) up to `V1.50.0`. @@ -18,8 +18,8 @@ Furthermore, this library is highly asynchronous where any potentially blocking This library can be installed through pip. Learn how to [setup and install pip first](https://pip.pypa.io/en/stable/installation/). -Then, it's as easy as running `pip install automlst-engine` in any terminal that has pip in it's path (any terminal where `pip --version` returns a valid version and install path). +Then, it's as easy as running `pip install autobigsst-engine` in any terminal that has pip in it's path (any terminal where `pip --version` returns a valid version and install path). ### CLI usage -This is a independent python library and thus does not have any form of direct user interface. One way of using it could be to create your own Python script that makes calls to this libraries functions. Alternatively, you may use `automlst-cli`, a `Python` package that implements a CLI for calling this library. \ No newline at end of file +This is a independent python library and thus does not have any form of direct user interface. One way of using it could be to create your own Python script that makes calls to this libraries functions. Alternatively, you may use `autobigsst-cli`, a `Python` package that implements a CLI for calling this library. \ No newline at end of file diff --git a/automlst.engine/meta.yaml b/automlst.engine/meta.yaml deleted file mode 100644 index 3af186c..0000000 --- a/automlst.engine/meta.yaml +++ /dev/null @@ -1,43 +0,0 @@ -{% set name = "automlst.engine" %} -{% set version = "0.5.2.dev2+gde36956" %} - -package: - name: {{ name|lower }} - version: {{ version }} - -source: - url: file:///workspaces/automlst.engine/dist/automlst_engine-0.5.2.dev2%2Bgde36956.tar.gz - sha256: 2dee4910744f063b7ec5c923bbf369c23151c82cc59b8b99da19e162414ba61d - -build: - noarch: python - script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation - number: 0 - -requirements: - host: - - python >=3.11 - - setuptools >=64 - - setuptools-scm >=8 - - pip - run: - - python >=3.11 - - biopython - - aiohttp - -test: - imports: - - automlst - commands: - - pip check - requires: - - pip - -about: - summary: A library to rapidly fetch fetch MLST profiles given sequences for various diseases. - license: GPL-3.0 - license_file: LICENSE - -extra: - recipe-maintainers: - - RealYHD diff --git a/environment.yml b/environment.yml index 9d7d2cb..8cce59e 100644 --- a/environment.yml +++ b/environment.yml @@ -11,4 +11,7 @@ dependencies: - setuptools_scm - pytest-cov - grayskull -- conda-build \ No newline at end of file +- conda-build +- anaconda-client +- conda-utils +- bioconda-build \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7a8cee3..309efd1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=64", "setuptools_scm>=8"] build-backend = "setuptools.build_meta" [project] -name = "automlst.engine" +name = "autobigsst.engine" dynamic = ["version"] readme = "README.md" authors = [ @@ -19,6 +19,10 @@ dependencies = [ requires-python = ">=3.11" description = "A library to rapidly fetch fetch MLST profiles given sequences for various diseases." +[project.urls] +Repository = "https://github.com/RealYHD/autobigsst.engine.git" +Issues = "https://github.com/RealYHD/autobigsst.engine/issues" + [tool.setuptools_scm] [tool.pyright] diff --git a/src/automlst/engine/__init__.py b/src/autobigsst/engine/__init__.py similarity index 100% rename from src/automlst/engine/__init__.py rename to src/autobigsst/engine/__init__.py diff --git a/src/automlst/engine/data/__init__.py b/src/autobigsst/engine/data/__init__.py similarity index 100% rename from src/automlst/engine/data/__init__.py rename to src/autobigsst/engine/data/__init__.py diff --git a/src/automlst/engine/data/local/__init__.py b/src/autobigsst/engine/data/local/__init__.py similarity index 100% rename from src/automlst/engine/data/local/__init__.py rename to src/autobigsst/engine/data/local/__init__.py diff --git a/src/automlst/engine/data/local/csv.py b/src/autobigsst/engine/data/local/csv.py similarity index 95% rename from src/automlst/engine/data/local/csv.py rename to src/autobigsst/engine/data/local/csv.py index d8e97f5..ed089ae 100644 --- a/src/automlst/engine/data/local/csv.py +++ b/src/autobigsst/engine/data/local/csv.py @@ -2,7 +2,7 @@ import csv from os import PathLike from typing import AsyncIterable, Mapping, Sequence, Union -from automlst.engine.data.structures.mlst import Allele, MLSTProfile +from autobigsst.engine.data.structures.mlst import Allele, MLSTProfile def dict_loci_alleles_variants_from_loci(alleles_map: Mapping[str, Sequence[Allele]]): diff --git a/src/automlst/engine/data/local/fasta.py b/src/autobigsst/engine/data/local/fasta.py similarity index 90% rename from src/automlst/engine/data/local/fasta.py rename to src/autobigsst/engine/data/local/fasta.py index 2637ddf..5dc3109 100644 --- a/src/automlst/engine/data/local/fasta.py +++ b/src/autobigsst/engine/data/local/fasta.py @@ -3,7 +3,7 @@ from io import TextIOWrapper from typing import Any, AsyncGenerator, Generator, Iterable, Sequence, Union from Bio import SeqIO -from automlst.engine.data.structures.genomics import NamedString +from autobigsst.engine.data.structures.genomics import NamedString async def read_fasta(handle: Union[str, TextIOWrapper]) -> AsyncGenerator[NamedString, Any]: fasta_sequences = asyncio.to_thread(SeqIO.parse, handle=handle, format="fasta") diff --git a/src/automlst/engine/data/remote/__init__.py b/src/autobigsst/engine/data/remote/__init__.py similarity index 100% rename from src/automlst/engine/data/remote/__init__.py rename to src/autobigsst/engine/data/remote/__init__.py diff --git a/src/automlst/engine/data/remote/databases/bigsdb.py b/src/autobigsst/engine/data/remote/databases/bigsdb.py similarity index 96% rename from src/automlst/engine/data/remote/databases/bigsdb.py rename to src/autobigsst/engine/data/remote/databases/bigsdb.py index 53a9d59..f51cb1d 100644 --- a/src/automlst/engine/data/remote/databases/bigsdb.py +++ b/src/autobigsst/engine/data/remote/databases/bigsdb.py @@ -5,9 +5,9 @@ from typing import Any, AsyncGenerator, AsyncIterable, Collection, Generator, It from aiohttp import ClientSession, ClientTimeout -from automlst.engine.data.structures.genomics import NamedString -from automlst.engine.data.structures.mlst import Allele, PartialAllelicMatchProfile, MLSTProfile -from automlst.engine.exceptions.database import NoBIGSdbExactMatchesException, NoBIGSdbMatchesException, NoSuchBIGSdbDatabaseException +from autobigsst.engine.data.structures.genomics import NamedString +from autobigsst.engine.data.structures.mlst import Allele, PartialAllelicMatchProfile, MLSTProfile +from autobigsst.engine.exceptions.database import NoBIGSdbExactMatchesException, NoBIGSdbMatchesException, NoSuchBIGSdbDatabaseException class BIGSdbMLSTProfiler(AbstractAsyncContextManager): diff --git a/src/automlst/engine/data/structures/__init__.py b/src/autobigsst/engine/data/structures/__init__.py similarity index 100% rename from src/automlst/engine/data/structures/__init__.py rename to src/autobigsst/engine/data/structures/__init__.py diff --git a/src/automlst/engine/data/structures/genomics.py b/src/autobigsst/engine/data/structures/genomics.py similarity index 100% rename from src/automlst/engine/data/structures/genomics.py rename to src/autobigsst/engine/data/structures/genomics.py diff --git a/src/automlst/engine/data/structures/mlst.py b/src/autobigsst/engine/data/structures/mlst.py similarity index 100% rename from src/automlst/engine/data/structures/mlst.py rename to src/autobigsst/engine/data/structures/mlst.py diff --git a/src/automlst/engine/exceptions/database.py b/src/autobigsst/engine/exceptions/database.py similarity index 100% rename from src/automlst/engine/exceptions/database.py rename to src/autobigsst/engine/exceptions/database.py diff --git a/tests/automlst/engine/data/local/test_csv.py b/tests/autobigsst/engine/data/local/test_csv.py similarity index 82% rename from tests/automlst/engine/data/local/test_csv.py rename to tests/autobigsst/engine/data/local/test_csv.py index 584523d..4f34924 100644 --- a/tests/automlst/engine/data/local/test_csv.py +++ b/tests/autobigsst/engine/data/local/test_csv.py @@ -1,5 +1,5 @@ -from automlst.engine.data.local.csv import dict_loci_alleles_variants_from_loci -from automlst.engine.data.structures.mlst import Allele +from autobigsst.engine.data.local.csv import dict_loci_alleles_variants_from_loci +from autobigsst.engine.data.structures.mlst import Allele def test_dict_loci_alleles_variants_from_loci_single_loci_not_list(): diff --git a/tests/automlst/engine/data/local/test_fasta.py b/tests/autobigsst/engine/data/local/test_fasta.py similarity index 78% rename from tests/automlst/engine/data/local/test_fasta.py rename to tests/autobigsst/engine/data/local/test_fasta.py index 9065458..14318c8 100644 --- a/tests/automlst/engine/data/local/test_fasta.py +++ b/tests/autobigsst/engine/data/local/test_fasta.py @@ -1,4 +1,4 @@ -from automlst.engine.data.local.fasta import read_fasta +from autobigsst.engine.data.local.fasta import read_fasta async def test_fasta_reader_not_none(): diff --git a/tests/automlst/engine/data/remote/databases/test_bigsdb.py b/tests/autobigsst/engine/data/remote/databases/test_bigsdb.py similarity index 97% rename from tests/automlst/engine/data/remote/databases/test_bigsdb.py rename to tests/autobigsst/engine/data/remote/databases/test_bigsdb.py index 0aa10de..73749eb 100644 --- a/tests/automlst/engine/data/remote/databases/test_bigsdb.py +++ b/tests/autobigsst/engine/data/remote/databases/test_bigsdb.py @@ -3,10 +3,10 @@ import re from typing import Collection, Sequence, Union from Bio import SeqIO import pytest -from automlst.engine.data.structures.genomics import NamedString -from automlst.engine.data.structures.mlst import Allele, MLSTProfile -from automlst.engine.exceptions.database import NoBIGSdbExactMatchesException, NoBIGSdbMatchesException -from automlst.engine.data.remote.databases.bigsdb import BIGSdbIndex, BIGSdbMLSTProfiler +from autobigsst.engine.data.structures.genomics import NamedString +from autobigsst.engine.data.structures.mlst import Allele, MLSTProfile +from autobigsst.engine.exceptions.database import NoBIGSdbExactMatchesException, NoBIGSdbMatchesException +from autobigsst.engine.data.remote.databases.bigsdb import BIGSdbIndex, BIGSdbMLSTProfiler def gene_scrambler(gene: str, mutation_site_count: Union[int, float], alphabet: Sequence[str] = ["A", "T", "C", "G"]): rand = random.Random(gene)