From 231b12b0ed7e204dccf2a4b96bcc03de8d23c8e2 Mon Sep 17 00:00:00 2001 From: Hakan Celik Date: Sun, 4 Dec 2022 22:25:36 +0300 Subject: [PATCH] v0.12.3 --- .github/workflows/docs.yml | 6 +-- .github/workflows/test.yml | 28 +++++++++++- .pre-commit-config.yaml | 2 +- Makefile | 71 +++++++++++++++++++++++++++++ action.yml | 2 +- docs/CHANGELOG.md | 5 ++ docs/CNAME | 1 - docs/{tutorial => }/installation.md | 0 docs/overrides/main.html | 6 ++- mkdocs.yml | 51 ++++++++++----------- setup.cfg | 16 ++++--- src/unimport/__init__.py | 2 +- 12 files changed, 146 insertions(+), 44 deletions(-) create mode 100644 Makefile delete mode 100644 docs/CNAME rename docs/{tutorial => }/installation.md (100%) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e4cb9ac4..8b4a7894 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,8 +1,8 @@ name: build-docs on: push: - branches: - - stable + tags: + - "**" jobs: build: runs-on: ubuntu-latest @@ -23,4 +23,4 @@ jobs: git config --local user.email "hakancelikdev@gmail.com" git config --local user.name "Hakan Celik" git fetch --all - mkdocs gh-deploy -m "Update Docs" --remote-branch gh-pages + mike deploy ${{github.ref_name}} latest --update-aliases --push diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb3378f2..b918c639 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,12 +1,36 @@ name: test on: [push, pull_request] jobs: - run: + test_with_python36: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, macos-latest, windows-latest] + python-version: ["3.6"] + steps: + - uses: actions/checkout@v2.3.4 + + - name: Set up Python${{ matrix.python-version }} + uses: actions/setup-python@v2.1.4 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + + - name: Install Dependencies for Python${{ matrix.python-version }} + run: | + python -m pip install --upgrade pip + python -m pip install tox + + - name: Test with pytest for Python${{ matrix.python-version }} + run: | + tox -e ${{ matrix.python-version }} + + test_other_python: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2.3.4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 00eca121..6ee1f8d0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: isort - repo: https://github.com/hakancelikdev/unimport - rev: 0.12.2 + rev: 0.12.3 hooks: - id: unimport args: diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..60a5309b --- /dev/null +++ b/Makefile @@ -0,0 +1,71 @@ +all: lint test clean + +.PHONY: dev +dev: + pip install -e .[test] + pip install pre-commit + +.PHONY: lint +lint: + git add . + pre-commit run --all-files + +.PHONY: test +test: + pytest tests -x -v --disable-warnings + +.PHONY: tox +tox: + tox + +.PHONY: clean +clean: + rm -rf `find . -name __pycache__` + rm -f `find . -type f -name '*.py[co]' ` + rm -f `find . -type f -name '*~' ` + rm -f `find . -type f -name '.*~' ` + rm -rf .cache + rm -rf .pytest_cache + rm -rf .mypy_cache + rm -rf htmlcov + rm -rf *.egg-info + rm -f .coverage + rm -f .coverage.* + rm -rf .tox + rm -rf build + +.PHONY: push +push: + git push origin head + +.PHONY: amend +amend: + git add . + git commit --amend --no-edit + git push origin head -f + +.PHONY: stable +stable: + git checkout main + git branch -D stable + git checkout -b stable + git push origin head -f + git checkout main + +.PHONY: git +git: + git config --local user.email "hakancelikdev@gmail.com" + git config --local user.name "Hakan Celik" + +.PHONY: publish +publish: + python -m pip install --upgrade pip + python -m pip install --upgrade build + python -m pip install --upgrade twine + python -m build + python -m twine upload dist/* + +.PHONY: docs +docs: + pip install -e .[docs] + mkdocs serve diff --git a/action.yml b/action.yml index 3253d450..84c8a17a 100644 --- a/action.yml +++ b/action.yml @@ -10,7 +10,7 @@ inputs: runs: using: "composite" steps: - - run: pip install --upgrade pip && python -m pip install unimport==0.12.2 + - run: pip install --upgrade pip && python -m pip install unimport==0.12.3 shell: bash - run: unimport --color auto --gitignore --ignore-init ${{ inputs.extra_args }} shell: bash diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6d941dd2..81d95212 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - YYYY-MM-DD +## [0.12.3] - 2022-12-04 + +### Added +- Multiple versions of the docs + ## [0.12.2] - 2022-11-09 ### 🐛 Fixes diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index 31a77146..00000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -unimport.hakancelik.dev diff --git a/docs/tutorial/installation.md b/docs/installation.md similarity index 100% rename from docs/tutorial/installation.md rename to docs/installation.md diff --git a/docs/overrides/main.html b/docs/overrides/main.html index 90941a1b..20143ca1 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -9,4 +9,8 @@ style="border: 0" > -{% endblock %} {%- block scripts %} {{ super() }} {%- endblock %} +{% endblock %} {% block outdated %} You're not viewing the latest version. + + Click here to go to latest. + +{% endblock %} diff --git a/mkdocs.yml b/mkdocs.yml index b0abe856..7856173c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,6 +1,10 @@ site_name: Unimport site_description: A linter, formatter for finding and removing unused import statements. site_url: https://unimport.hakancelik.dev +repo_url: https://github.com/hakancelikdev/unimport +repo_name: hakancelikdev/unimport +edit_uri: https://github.com/hakancelikdev/unimport/tree/main/docs +copyright: Copyright © 2020 - 2020 Hakan Çelik markdown_extensions: - fenced_code @@ -47,32 +51,37 @@ plugins: - search: separator: '[\s\-\.]+' prebuild_index: true - - git-revision-date-localized: type: date enable_creation_date: true - - minify: minify_html: true + - mike: + canonical_version: latest extra: version: provider: mike - default: stable - + default: latest + analytics: + provider: google + property: G-2EGM5WWEED + consent: + title: Cookie consent + description: >- + We use cookies to recognize your repeated visits and preferences, as well as to + measure the effectiveness of our documentation and whether users find what they're + searching for. With your consent, you're helping us to make our documentation + better. social: - icon: fontawesome/brands/discord link: https://discord.com/invite/6z8YXy4 - - icon: fontawesome/brands/twitter link: https://twitter.com/hakancelikdev - - icon: fontawesome/brands/linkedin link: https://www.linkedin.com/in/hakancelikdev - - icon: fontawesome/solid/globe link: https://hakancelik.dev - homepage: https://unimport.hakancelik.dev theme: @@ -83,49 +92,37 @@ theme: - navigation.instant - navigation.tracking - navigation.indexes - - navigation.top - search.suggest - search.highlight - search.share - header.autohide - + - navigation.top palette: - media: "(prefers-color-scheme: light)" scheme: default - primary: red + primary: white accent: amber toggle: - icon: material/lightbulb-outline + icon: material/weather-sunny name: Switch to dark mode - - media: "(prefers-color-scheme: dark)" scheme: slate - primary: red + primary: black accent: amber toggle: - icon: material/lightbulb + icon: material/weather-night name: Switch to light mode - font: text: Noto Sans code: Roboto Mono - icon: repo: fontawesome/brands/github-alt edit: material/file-document-edit-outline -copyright: Copyright © 2020 - 2020 Hakan Çelik -repo_url: https://github.com/hakancelikdev/unimport -repo_name: hakancelikdev/unimport -edit_uri: https://github.com/hakancelikdev/unimport/tree/main/docs - nav: - - Unimport: index.md - - Languages: - - en: / - - tr: /tr/ + - Overview: index.md + - Installation: installation.md - User Guide: - - tutorial/installation.md - tutorial/command-line-options.md - tutorial/supported-behaviors.md - tutorial/other-useful-features.md diff --git a/setup.cfg b/setup.cfg index 19e758c9..7d8fb6f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -56,15 +56,17 @@ console_scripts = [options.extras_require] docs = - mkdocs==1.3.0 - mkdocs-material==8.3.6 + mkdocs==1.4.2 + mkdocs-material==8.5.11 mkdocs-markdownextradata-plugin==0.2.5 - mkdocs-minify-plugin==0.5.0 - mkdocs-git-revision-date-localized-plugin==1.0.1 + mkdocs-minify-plugin==0.6.2 + mkdocs-git-revision-date-localized-plugin==1.1.0 + mike==1.1.2 test = - pytest==6.2.4 - pytest-cov==2.12.1 - semantic-version==2.8.5 + pytest==6.2.4; python_version == '3.6' + pytest==7.2.0; python_version != '3.6' + pytest-cov==4.0.0 + semantic-version==2.10.0 [options.package_data] * = diff --git a/src/unimport/__init__.py b/src/unimport/__init__.py index dad3d79a..80296cba 100644 --- a/src/unimport/__init__.py +++ b/src/unimport/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.12.2" +__version__ = "0.12.3" __description__ = "A linter, formatter for finding and removing unused import statements."