diff --git a/.github/workflows/publish_python.yml b/.github/workflows/publish_python.yml new file mode 100644 index 0000000..8e0eef2 --- /dev/null +++ b/.github/workflows/publish_python.yml @@ -0,0 +1,51 @@ +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + build: + name: Build distribution ๐Ÿ“ฆ + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to PyPI + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/genomeuploader + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution ๐Ÿ“ฆ to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/pytest_workflow.yml b/.github/workflows/pytest_workflow.yml new file mode 100644 index 0000000..c0b190f --- /dev/null +++ b/.github/workflows/pytest_workflow.yml @@ -0,0 +1,75 @@ +name: Run pytest + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + pytest_38: + name: Run pytest 3.8 + runs-on: ubuntu-latest + environment: pypi + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.8" + - name: Install dependencies + run: pip install .[test] + - uses: pavelzw/pytest-action@v2 + env: + ENA_WEBIN: ${{ secrets.ENA_WEBIN }} + ENA_WEBIN_PASSWORD: ${{ secrets.ENA_WEBIN_PASSWORD }} + with: + emoji: false + verbose: true + job-summary: true + + pytest_39: + name: Run pytest 3.9 + needs: + - pytest_38 + runs-on: ubuntu-latest + environment: pypi + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + - name: Install dependencies + run: pip install .[test] + - uses: pavelzw/pytest-action@v2 + env: + ENA_WEBIN: ${{ secrets.ENA_WEBIN }} + ENA_WEBIN_PASSWORD: ${{ secrets.ENA_WEBIN_PASSWORD }} + with: + emoji: false + verbose: true + job-summary: true + + pytest_310: + name: Run pytest 3.10 + needs: + - pytest_39 + runs-on: ubuntu-latest + environment: pypi + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install dependencies + run: pip install .[test] + - uses: pavelzw/pytest-action@v2 + env: + ENA_WEBIN: ${{ secrets.ENA_WEBIN }} + ENA_WEBIN_PASSWORD: ${{ secrets.ENA_WEBIN_PASSWORD }} + with: + emoji: false + verbose: true + job-summary: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 05542ac..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Testing - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.8, 3.9, "3.10"] - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install Dependencies - run: | - pip install .[test] - - name: ๐Ÿงช - Testing - run: | - pytest -v diff --git a/genomeuploader/__init__.py b/genomeuploader/__init__.py index 8c0d5d5..a33997d 100644 --- a/genomeuploader/__init__.py +++ b/genomeuploader/__init__.py @@ -1 +1 @@ -__version__ = "2.0.0" +__version__ = '2.1.0' diff --git a/pyproject.toml b/pyproject.toml index 546964f..1a871b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [project] -name = "genomeuploader" +name = "genome_uploader" +version = "2.1.0" readme = "README.md" authors = [ {name = "MGnify team", email = "metagenomics-help@ebi.ac.uk"}, ] license = {text = "Apache Software License 2.0"} keywords = ["bioinformatics", "tool", "metagenomics"] -dynamic = ["version"] description = "Python script to upload bins and MAGs in fasta format to ENA (European Nucleotide Archive). This script generates xmls and manifests necessary for submission with webin-cli." requires-python = ">=3.8" classifiers = [ @@ -26,6 +26,10 @@ dependencies = [ "python-dotenv==1.0.1" ] +[project.urls] +Homepage = "https://github.com/EBI-Metagenomics/genome_uploader" +Issues = "https://github.com/EBI-Metagenomics/genome_uploader/issues" + [tool.pytest.ini_options] minversion = "6.0" addopts = "-ra -q" @@ -43,7 +47,9 @@ dev = [ "bump-my-version==0.9.2", ] test = [ - "pytest==7.1.2", + "pytest==7.4.0", + "pytest-md==0.2.0", + "pytest-workflow==2.0.1", "pytest-cov==3.0.0", ] @@ -54,9 +60,6 @@ build-backend = "setuptools.build_meta" [tool.setuptools] packages = ["genomeuploader"] -[tool.setuptools.dynamic] -version = {attr = "genomeuploader.__version__"} - [project.scripts] genome_upload = "genomeuploader.genome_upload:main" diff --git a/pytest.ini b/pytest.ini index 0e86f06..8e78522 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,3 @@ [pytest] python_files = tests/*.py -pythonpath = . \ No newline at end of file +testpaths = tests