From f642d5f0907cde928e05d78bb41bad5a497616fa Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Fri, 29 Oct 2021 02:42:03 +0900 Subject: [PATCH 1/6] =?UTF-8?q?#55=20Update=20package=20version=20(0.2.4?= =?UTF-8?q?=20=E2=86=92=200.3.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astro_ph/__init__.py | 2 +- pyproject.toml | 2 +- tests/test_metadata.py | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/astro_ph/__init__.py b/astro_ph/__init__.py index b173e92..5fca814 100644 --- a/astro_ph/__init__.py +++ b/astro_ph/__init__.py @@ -1,7 +1,7 @@ # flake8: noqa # type: ignore __author__ = "Akio Taniguchi" -__version__ = "0.2.4" +__version__ = "0.3.0" # submodules diff --git a/pyproject.toml b/pyproject.toml index 7b67b4c..5e28632 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "astro-ph" -version = "0.2.4" +version = "0.3.0" description = "Translate and post arXiv articles to various apps" authors = ["Akio Taniguchi "] keywords = ["arxiv", "astro-ph", "translation"] diff --git a/tests/test_metadata.py b/tests/test_metadata.py index a3c58d5..6c1e95c 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -1,11 +1,10 @@ -# third-party packages +# dependencies import astro_ph -from typing_extensions import Final # constants -AUTHOR: Final[str] = "Akio Taniguchi" -VERSION: Final[str] = "0.2.4" +AUTHOR = "Akio Taniguchi" +VERSION = "0.3.0" # test functions From ae9a3eb4ce49b59b8f2304dae76a3d4f5da2707f Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Fri, 29 Oct 2021 02:42:31 +0900 Subject: [PATCH 2/6] #55 Update command option in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5220d5e..ca3bbb5 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ In this case, you need to [create a custom Slack app to get an URL of incoming w ```shell $ astro-ph slack --keywords galaxy,galaxies \ --categories astro-ph.GA,astro-ph.IM \ - --lang_to ja \ + --language_to ja \ --webhook_url https://hooks.slack.com/services/***/*** ``` From 78cd897e4f4766ec0f0ed58036a3225566d7ab81 Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Fri, 29 Oct 2021 02:43:00 +0900 Subject: [PATCH 3/6] #55 Update test workflow --- .github/workflows/tests.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1b3db09..f1760a4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,22 +3,24 @@ name: Tests on: push: branches: - - master + - main pull_request: branches: - - master + - main jobs: job: - name: Test ${{ matrix.python-version }} + name: Test (Python ${{ matrix.python-version }}) runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: ["3.8", "3.9", "3.10"] + env: + POETRY_VIRTUALENVS_CREATE: false + TARGET_DIRS: astro_ph docs tests steps: - uses: actions/checkout@v2 - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -26,12 +28,12 @@ jobs: sudo apt install pandoc pip install poetry poetry install - poetry run playwright install chromium - - name: Lint by Flake8 - run: poetry run flake8 astro_ph docs tests - - name: Format by Black - run: poetry run black --check astro_ph docs tests - - name: Test by pytest - run : poetry run pytest -v tests - - name: Build docs - run: poetry run scripts/docs + playwright install chromium + - name: Test code's formatting (Black) + run: black --check ${TARGET_DIRS} + - name: Test code's style (Flake8) + run: flake8 ${TARGET_DIRS} + - name: Test code's execution (pytest) + run: pytest -v tests + - name: Test docs' build (Sphinx) + run: docs/build From 1296a5da9ed2833d7373bef1aa35829cbe74856e Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Fri, 29 Oct 2021 02:44:21 +0900 Subject: [PATCH 4/6] #55 Move script for docs' build --- scripts/docs => docs/build | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/docs => docs/build (100%) diff --git a/scripts/docs b/docs/build similarity index 100% rename from scripts/docs rename to docs/build From 3f0368998855fc0e5069cfb3efb117295d6cdc0b Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Fri, 29 Oct 2021 02:48:25 +0900 Subject: [PATCH 5/6] #55 Update gh-pages workflow --- .github/workflows/gh-pages.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 7e85ef1..fc95a27 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -10,23 +10,24 @@ jobs: job: name: GitHub Pages runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + POETRY_VIRTUALENVS_CREATE: false steps: - uses: actions/checkout@v2 - name: Setup Python uses: actions/setup-python@v2 - with: - python-version: 3.8 - name: Install dependencies run: | sudo apt install pandoc pip install poetry poetry install - name: Build docs - run: poetry run scripts/docs + run: docs/build - name: Deploy docs uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: $GITHUB_TOKEN publish_dir: ./docs/_build publish_branch: gh-pages force_orphan: true From dc071d9c47b7df47a907e0870acafbaece07d675 Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Fri, 29 Oct 2021 02:48:48 +0900 Subject: [PATCH 6/6] #55 Update PyPI workflow --- .github/workflows/pypi.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index a02b936..0fb1790 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -9,16 +9,10 @@ jobs: job: name: PyPI runs-on: ubuntu-latest + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} steps: - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Install dependencies - run: | - pip install poetry - - name: Publish package - run: | - poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} - poetry publish --build + - uses: actions/setup-python@v2 + - name: Publish package to PyPI + run: pip install poetry && poetry publish --build