From f6af7f8b892b8aa349ec07169b8cbfa9f40d3ae2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 20:57:41 +0000 Subject: [PATCH 01/23] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.3.0 → v3.8.3](https://github.com/asottile/reorder_python_imports/compare/v3.3.0...v3.8.3) - [github.com/asottile/add-trailing-comma: v2.2.3 → v2.3.0](https://github.com/asottile/add-trailing-comma/compare/v2.2.3...v2.3.0) - [github.com/Lucas-C/pre-commit-hooks: v1.2.0 → v1.3.1](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.2.0...v1.3.1) - [github.com/asottile/setup-cfg-fmt: v1.20.1 → v2.0.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.1...v2.0.0) - [github.com/psf/black: 22.6.0 → 22.8.0](https://github.com/psf/black/compare/22.6.0...22.8.0) - [github.com/pycqa/flake8: 4.0.1 → 5.0.4](https://github.com/pycqa/flake8/compare/4.0.1...5.0.4) - [github.com/asottile/yesqa: v1.3.0 → v1.4.0](https://github.com/asottile/yesqa/compare/v1.3.0...v1.4.0) - [github.com/pre-commit/mirrors-mypy: v0.961 → v0.981](https://github.com/pre-commit/mirrors-mypy/compare/v0.961...v0.981) --- .pre-commit-config.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 53c150d..857ec50 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,24 +40,24 @@ repos: - id: trailing-whitespace - repo: https://github.com/asottile/reorder_python_imports - rev: v3.3.0 + rev: v3.8.3 hooks: - id: reorder-python-imports - repo: https://github.com/asottile/add-trailing-comma - rev: v2.2.3 + rev: v2.3.0 hooks: - id: add-trailing-comma args: ["--py36-plus"] - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.2.0 + rev: v1.3.1 hooks: - id: remove-crlf - id: remove-tabs - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.1 + rev: v2.0.0 hooks: - id: setup-cfg-fmt @@ -72,24 +72,24 @@ repos: - id: text-unicode-replacement-char - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 22.8.0 hooks: - id: black args: ["--skip-string-normalization"] - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + rev: 5.0.4 hooks: - id: flake8 args: ["--max-line-length=88"] - repo: https://github.com/asottile/yesqa - rev: v1.3.0 + rev: v1.4.0 hooks: - id: yesqa - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.961 + rev: v0.981 hooks: - id: mypy additional_dependencies: From d335383257fd9e66ad7f3db2b2288f4655ced9b9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 20:57:54 +0000 Subject: [PATCH 02/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 5 ----- 1 file changed, 5 deletions(-) diff --git a/setup.cfg b/setup.cfg index 820f177..38a392d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,11 +19,6 @@ classifiers = Operating System :: POSIX :: Linux Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython Topic :: Terminals Topic :: Utilities From e24fe533266f429ab463b77b2b3714d4f93e2b11 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Fri, 7 Oct 2022 19:35:04 +0200 Subject: [PATCH 03/23] chore: Keep version classifiers --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 857ec50..d3e6206 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,6 +60,7 @@ repos: rev: v2.0.0 hooks: - id: setup-cfg-fmt + args: ["--include-version-classifiers"] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.9.0 From 1f3afc04d3f0d127cff5dba79682b99061e14431 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 7 Oct 2022 17:37:04 +0000 Subject: [PATCH 04/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.cfg b/setup.cfg index 38a392d..820f177 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,11 @@ classifiers = Operating System :: POSIX :: Linux Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython Topic :: Terminals Topic :: Utilities From 0ae0e073e728b5efb5c8db627473c017ca31cf27 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Fri, 7 Oct 2022 19:41:20 +0200 Subject: [PATCH 05/23] ci: Switch to a more readable array formatting --- .pre-commit-config.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3e6206..4830833 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,11 +31,13 @@ repos: - id: end-of-file-fixer - id: fix-byte-order-marker - id: fix-encoding-pragma - args: ["--remove"] + args: + - "--remove" - id: mixed-line-ending - id: name-tests-test - id: pretty-format-json - args: ["--autofix"] + args: + - "--autofix" - id: requirements-txt-fixer - id: trailing-whitespace @@ -48,7 +50,8 @@ repos: rev: v2.3.0 hooks: - id: add-trailing-comma - args: ["--py36-plus"] + args: + - "--py36-plus" - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.3.1 @@ -60,7 +63,8 @@ repos: rev: v2.0.0 hooks: - id: setup-cfg-fmt - args: ["--include-version-classifiers"] + args: + - "--include-version-classifiers" - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.9.0 @@ -76,13 +80,15 @@ repos: rev: 22.8.0 hooks: - id: black - args: ["--skip-string-normalization"] + args: + - "--skip-string-normalization" - repo: https://github.com/pycqa/flake8 rev: 5.0.4 hooks: - id: flake8 - args: ["--max-line-length=88"] + args: + - "--max-line-length=88" - repo: https://github.com/asottile/yesqa rev: v1.4.0 From 3a4ce29192f72722b46e67fda7b59209068ff171 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Mon, 10 Oct 2022 19:06:56 +0200 Subject: [PATCH 06/23] build: Use `hatch` as build system and migrate to `pyproject.toml` --- pyproject.toml | 103 +++++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 85 ---------------------------------------- setup.py | 3 -- 3 files changed, 103 insertions(+), 88 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1e40eb6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,103 @@ +[build-system] +requires = [ + "hatchling>=1.10.0", +] +build-backend = "hatchling.build" + +[project] +name = "timezone-converter" +version = "0.11.0" +description = "Compare your local timezone with foreign ones." +license = "MIT" +license-files = { paths = ["LICENSE"] } +readme = "README.md" +authors = [ + { name = "Iago Alonso", email = "deejaynof@gmail.com" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: End Users/Desktop", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Terminals", + "Topic :: Utilities", + "Typing :: Typed", +] +requires-python = ">=3.6.1" +dependencies = [ + "pytz>=2021.1", + "rich>=10.0.1", +] + +[project.scripts] +timezone-converter = "timezone_converter.main:main" + +[project.urls] +Homepage = "https://github.com/ibLeDy/timezone-converter" + +[tool.hatch.build.targets.sdist] +include = [ + "timezone_converter", +] +exclude = [ + "tests*", +] + +[tool.hatch.build.targets.wheel] +packages = [ + "timezone_converter", +] + +[tool.mypy] +check_untyped_defs = true +warn_redundant_casts = true +warn_unused_ignores = true +disallow_any_generics = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_optional = true +no_implicit_reexport = true + +[[tool.mypy.overrides]] +module = "tests.*" +disallow_untyped_defs = false + +[tool.coverage.run] +plugins = "covdefaults" + +[tool.tox] +legacy_tox_ini = """ +[tox] +envlist = py36, py37, py38, py39 + +[gh-actions] +python = + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39 + +[testenv] +commands = + timezone-converter + timezone-converter --help + timezone-converter tijuana + timezone-converter tijuana --single + timezone-converter tijuana --single 14 + timezone-converter tijuana new_york + timezone-converter tijuana new_york --single + timezone-converter tijuana --zone + timezone-converter tijuana --list + timezone-converter tijuana --list tbd +""" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 820f177..0000000 --- a/setup.cfg +++ /dev/null @@ -1,85 +0,0 @@ -[metadata] -name = timezone_converter -version = 0.10.0 -description = Compare your local timezone with foreign ones. -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/ibLeDy/timezone-converter -author = Iago Alonso -author_email = deejaynof@gmail.com -license = MIT -license_file = LICENSE -classifiers = - Development Status :: 4 - Beta - Environment :: Console - Intended Audience :: End Users/Desktop - License :: OSI Approved :: MIT License - Operating System :: MacOS - Operating System :: Microsoft :: Windows - Operating System :: POSIX :: Linux - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: Implementation :: CPython - Topic :: Terminals - Topic :: Utilities - Typing :: Typed - -[options] -packages = find: -install_requires = - pytz>=2021.1 - rich>=10.0.1 - importlib-metadata;python_version<"3.8" -python_requires = >=3.6.1 - -[options.packages.find] -exclude = - tests* - -[options.entry_points] -console_scripts = - timezone-converter = timezone_converter.main:main - -[coverage:run] -plugins = covdefaults - -[tox:tox] -envlist = py36, py37, py38, py39 - -[gh-actions] -python = - 3.6: py36 - 3.7: py37 - 3.8: py38 - 3.9: py39 - -[testenv] -commands = - timezone-converter - timezone-converter --help - timezone-converter tijuana - timezone-converter tijuana --single - timezone-converter tijuana --single 14 - timezone-converter tijuana new_york - timezone-converter tijuana new_york --single - timezone-converter tijuana --zone - timezone-converter tijuana --list - timezone-converter tijuana --list tbd - -[mypy] -check_untyped_defs = true -warn_redundant_casts = true -warn_unused_ignores = true -disallow_any_generics = true -disallow_incomplete_defs = true -disallow_untyped_defs = true -no_implicit_optional = true -no_implicit_reexport = true - -[mypy-tests.*] -disallow_untyped_defs = false diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() From 55083ef780cca0b806d7dc1f614ee657c8fe0c80 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Mon, 10 Oct 2022 19:09:41 +0200 Subject: [PATCH 07/23] build: Tell `tox` to use an `isolated_build` https://tox.wiki/en/latest/example/package.html --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 1e40eb6..4ce19c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,6 +80,7 @@ plugins = "covdefaults" legacy_tox_ini = """ [tox] envlist = py36, py37, py38, py39 +isolated_build = True [gh-actions] python = From f38412f83aaa7b364331a92dcb3a78278ec78bf6 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Mon, 10 Oct 2022 19:19:31 +0200 Subject: [PATCH 08/23] build: Add missing dependency --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 4ce19c6..d379916 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ classifiers = [ ] requires-python = ">=3.6.1" dependencies = [ + "importlib-metadata;python_version<'3.8'", "pytz>=2021.1", "rich>=10.0.1", ] From 5565a5bed744e76e552fe9c791a6d808a61df108 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Mon, 10 Oct 2022 19:23:30 +0200 Subject: [PATCH 09/23] style: Formatting --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d379916..c9a3ab3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ classifiers = [ ] requires-python = ">=3.6.1" dependencies = [ - "importlib-metadata;python_version<'3.8'", + "importlib-metadata; python_version < '3.8'", "pytz>=2021.1", "rich>=10.0.1", ] From 3f4562e5a33baa621c5a672cc259bf3247f76ece Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Mon, 10 Oct 2022 19:25:38 +0200 Subject: [PATCH 10/23] build!: Deprecate Python `3.6` and add support for `3.10` --- .github/workflows/integration.yml | 6 +++--- pyproject.toml | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 7a5fc2d..4f1383d 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 @@ -59,7 +59,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 diff --git a/pyproject.toml b/pyproject.toml index c9a3ab3..018da37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,6 @@ classifiers = [ "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -34,7 +33,7 @@ classifiers = [ "Topic :: Utilities", "Typing :: Typed", ] -requires-python = ">=3.6.1" +requires-python = ">=3.7" dependencies = [ "importlib-metadata; python_version < '3.8'", "pytz>=2021.1", @@ -80,15 +79,15 @@ plugins = "covdefaults" [tool.tox] legacy_tox_ini = """ [tox] -envlist = py36, py37, py38, py39 +envlist = py37, py38, py39, py310 isolated_build = True [gh-actions] python = - 3.6: py36 3.7: py37 3.8: py38 3.9: py39 + 3.10: py310 [testenv] commands = From e8e9f5cfad035753bd5c90d2879d7859066d0492 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Mon, 10 Oct 2022 20:13:20 +0200 Subject: [PATCH 11/23] build: Add Docker support --- .dockerignore | 12 ++++++++++++ Dockerfile | 21 +++++++++++++++++++++ README.md | 6 ++++++ 3 files changed, 39 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e98ef21 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +.git +.github +.mypy_cache +.pre-commit-config.yaml +.pytest_cache +.venv +.tox +*.egg-info +build +dist +requirements-dev.txt +test diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..086d63b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.10-slim-buster + +ENV PYTHONUNBUFFERED 1 + +LABEL maintainer="deejaynof@gmail.com" + +RUN : \ + && groupadd --gid 1001 timezone-converter \ + && useradd --uid 1001 --gid timezone-converter --system --create-home --home-dir /home/timezone-converter timezone-converter \ + && : +USER timezone-converter + +WORKDIR /opt +COPY --chown=timezone-converter:timezone-converter . . + +ENV PATH="/home/timezone-converter/.local/bin:$PATH" +RUN : \ + && python3 -m pip --no-cache-dir install . \ + && : + +ENTRYPOINT [ "timezone-converter" ] diff --git a/README.md b/README.md index 536ba2a..7f73bf8 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,12 @@ pip install -U timezone-converter timezone-converter [ ...] ``` +### Docker + +```bash +docker run --rm -t timezone-converter [ ...] +``` + ## Features ### Comparison between multiple timezones From ff7a822a7fb70553e7f59fa296dbc08379ef09e3 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Mon, 10 Oct 2022 20:15:53 +0200 Subject: [PATCH 12/23] build: Fix image uri --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f73bf8..0d8d0c2 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ timezone-converter [ ...] ### Docker ```bash -docker run --rm -t timezone-converter [ ...] +docker run --rm -t bledy/timezone-converter [ ...] ``` ## Features From 37f23f38640c6e2e876ff5233bccbae5279749c8 Mon Sep 17 00:00:00 2001 From: FaithKovi Date: Fri, 14 Oct 2022 14:15:43 +0100 Subject: [PATCH 13/23] build: automated docker image build Signed-off-by: FaithKovi --- .github/workflows/deployment.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 44fee0d..36466ce 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -26,3 +26,28 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} + + - name: Login to Docker Hub + id: login-dockerhub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + + - name: Build, tag, and push image to Docker Hub + id: build-image + context: . + env: + DOCKERHUB_NAMESPACE: ${{ steps.login-dockerhub.outputs.registry }} + IMAGE_TAG: ${{ steps.meta.outputs.tags }} + run: | + # Build a docker container and push it to Docker Hub + docker build -t $DOCKERHUB_NAMESPACE/timezone-converter:$IMAGE_TAG . + docker push $DOCKERHUB_NAMESPACE/timezone-converter:$IMAGE_TAG + echo "::set-output name=image::$DOCKERHUB_NAMESPACE/timezone-converter:$IMAGE_TAG" + + From 89cc44da0cc36e4a8038c4108564ce5006a0bb8d Mon Sep 17 00:00:00 2001 From: FaithKovi Date: Fri, 21 Oct 2022 16:04:57 +0100 Subject: [PATCH 14/23] build: automated docker image build Signed-off-by: FaithKovi --- .github/workflows/deployment.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 36466ce..c29ecd5 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -27,27 +27,28 @@ jobs: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub id: login-dockerhub - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - - - name: Build, tag, and push image to Docker Hub - id: build-image - context: . - env: - DOCKERHUB_NAMESPACE: ${{ steps.login-dockerhub.outputs.registry }} - IMAGE_TAG: ${{ steps.meta.outputs.tags }} - run: | - # Build a docker container and push it to Docker Hub - docker build -t $DOCKERHUB_NAMESPACE/timezone-converter:$IMAGE_TAG . - docker push $DOCKERHUB_NAMESPACE/timezone-converter:$IMAGE_TAG - echo "::set-output name=image::$DOCKERHUB_NAMESPACE/timezone-converter:$IMAGE_TAG" + uses: docker/metadata-action@v4 + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: :${{ steps.meta.outputs.tags }} From b14e76f129d4e2296f01ea25b62cb1209f64f432 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Fri, 4 Nov 2022 21:27:51 +0100 Subject: [PATCH 15/23] build: Bump minimum versions --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 018da37..2df3cec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,8 +36,8 @@ classifiers = [ requires-python = ">=3.7" dependencies = [ "importlib-metadata; python_version < '3.8'", - "pytz>=2021.1", - "rich>=10.0.1", + "pytz>=2022.6", + "rich>=12.6.0", ] [project.scripts] From 72a8f5ddec2e116cb64c1de78e7523fe3028caa7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 20:49:58 +0000 Subject: [PATCH 16/23] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.8.3 → v3.9.0](https://github.com/asottile/reorder_python_imports/compare/v3.8.3...v3.9.0) - [github.com/asottile/setup-cfg-fmt: v2.0.0 → v2.2.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.0.0...v2.2.0) - [github.com/psf/black: 22.8.0 → 22.10.0](https://github.com/psf/black/compare/22.8.0...22.10.0) - [github.com/pre-commit/mirrors-mypy: v0.981 → v0.982](https://github.com/pre-commit/mirrors-mypy/compare/v0.981...v0.982) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4830833..aa170b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.3 + rev: v3.9.0 hooks: - id: reorder-python-imports @@ -60,7 +60,7 @@ repos: - id: remove-tabs - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.0.0 + rev: v2.2.0 hooks: - id: setup-cfg-fmt args: @@ -77,7 +77,7 @@ repos: - id: text-unicode-replacement-char - repo: https://github.com/psf/black - rev: 22.8.0 + rev: 22.10.0 hooks: - id: black args: @@ -96,7 +96,7 @@ repos: - id: yesqa - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.981 + rev: v0.982 hooks: - id: mypy additional_dependencies: From 950aeb09363855157da7a4525a282faccf3d5e03 Mon Sep 17 00:00:00 2001 From: FaithKovi Date: Thu, 10 Nov 2022 14:21:59 +0100 Subject: [PATCH 17/23] build: add docker image name Signed-off-by: FaithKovi --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index c29ecd5..4da19a6 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -49,6 +49,6 @@ jobs: with: context: . push: true - tags: :${{ steps.meta.outputs.tags }} + tags: bledy/timezone-converter:${{ steps.meta.outputs.tags }} From 6460bc79b8f20f105c390d7955c3abdc4f5eb36f Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Thu, 10 Nov 2022 17:49:22 +0100 Subject: [PATCH 18/23] style: Formatting --- .github/workflows/deployment.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 4da19a6..e915e21 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -39,7 +39,7 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v4 @@ -50,5 +50,3 @@ jobs: context: . push: true tags: bledy/timezone-converter:${{ steps.meta.outputs.tags }} - - From 6e149d740b1bb8fc041feabf88bb42e05c01b1f9 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Thu, 10 Nov 2022 17:53:09 +0100 Subject: [PATCH 19/23] v0.12.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2df3cec..b7a2c81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "timezone-converter" -version = "0.11.0" +version = "0.12.0" description = "Compare your local timezone with foreign ones." license = "MIT" license-files = { paths = ["LICENSE"] } From 598d7e68d764d16d579e3111193b5d3cb40f8601 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Thu, 10 Nov 2022 18:07:50 +0100 Subject: [PATCH 20/23] fix: Use metadata step to extract SemVer tag --- .github/workflows/deployment.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index e915e21..b148d56 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -33,6 +33,13 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: bledy/timezone-converter + tags: type=semver,pattern={{version}} + - name: Login to Docker Hub id: login-dockerhub uses: docker/login-action@v2 @@ -40,13 +47,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - - name: Build and push uses: docker/build-push-action@v3 with: context: . push: true - tags: bledy/timezone-converter:${{ steps.meta.outputs.tags }} + tags: ${{ steps.meta.outputs.tags }} From 1b687923e020da379e81a55ab01a84083cbee7db Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Thu, 10 Nov 2022 18:09:02 +0100 Subject: [PATCH 21/23] v0.12.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b7a2c81..46fb270 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "timezone-converter" -version = "0.12.0" +version = "0.12.1" description = "Compare your local timezone with foreign ones." license = "MIT" license-files = { paths = ["LICENSE"] } From fa9ba1e7e7d14f8158dde2c934fe4f5b1b00f73a Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Thu, 26 Oct 2023 13:56:52 +0200 Subject: [PATCH 22/23] build: Bump minimum and maximum supported versions --- Dockerfile | 2 +- pyproject.toml | 12 +++++++----- timezone_converter/constants.py | 7 +------ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 086d63b..cb60ecf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10-slim-buster +FROM python:3.12-slim-bullseye ENV PYTHONUNBUFFERED 1 diff --git a/pyproject.toml b/pyproject.toml index 46fb270..aa0dc4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,18 +24,19 @@ classifiers = [ "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Terminals", "Topic :: Utilities", "Typing :: Typed", ] -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = [ - "importlib-metadata; python_version < '3.8'", + "importlib-metadata", "pytz>=2022.6", "rich>=12.6.0", ] @@ -79,15 +80,16 @@ plugins = "covdefaults" [tool.tox] legacy_tox_ini = """ [tox] -envlist = py37, py38, py39, py310 +envlist = py38, py39, py310, py311, py312 isolated_build = True [gh-actions] python = - 3.7: py37 3.8: py38 3.9: py39 3.10: py310 + 3.11: py311 + 3.12: py312 [testenv] commands = diff --git a/timezone_converter/constants.py b/timezone_converter/constants.py index 7347f7a..f599181 100644 --- a/timezone_converter/constants.py +++ b/timezone_converter/constants.py @@ -1,8 +1,3 @@ -import sys - -if sys.version_info < (3, 8): - import importlib_metadata as metadata -else: - from importlib import metadata +from importlib import metadata VERSION = metadata.version('timezone-converter') From 53bc97d2e4a140678515bb0b53e91e6dfd1173a5 Mon Sep 17 00:00:00 2001 From: Iago Alonso Date: Thu, 26 Oct 2023 13:58:51 +0200 Subject: [PATCH 23/23] fix: Bump versions in integration workflow too --- .github/workflows/integration.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4f1383d..bd00206 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9, "3.10"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9, "3.10"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 @@ -59,7 +59,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9, "3.10"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2