Skip to content

Commit

Permalink
Finally, version 1.0.0 is ready #271
Browse files Browse the repository at this point in the history
  • Loading branch information
hakancelikdev committed Jul 7, 2023
1 parent f26c6b3 commit 7e28d68
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-python@v2.1.4
- uses: actions/checkout@v3.5.3
- uses: actions/setup-python@v4.6.1
with:
python-version: "3.8"
architecture: "x64"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v3.5.3
- uses: actions/setup-python@v4.6.1
- name: Install dependencies for pre-commit
run: |
python -m pip install --upgrade pip
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-python@v2.1.4
- uses: actions/checkout@v3.5.3
- uses: actions/setup-python@v4.6.1
with:
python-version: "3.8"
architecture: "x64"
Expand All @@ -29,8 +29,8 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-python@v2.1.4
- uses: actions/checkout@v3.5.3
- uses: actions/setup-python@v4.6.1
with:
python-version: "3.8"
architecture: "x64"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
os: [ubuntu-20.04, macos-latest, windows-latest]
python-version: ["3.6"]
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3.5.3

- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -32,10 +32,10 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3.5.3

- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -52,10 +52,10 @@ jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3.5.3

- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unimport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v3.5.3
- uses: actions/setup-python@v4.6.1
- name: unimport
uses: ./
with:
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ repos:
- id: isort

- repo: https://github.com/hakancelikdev/unimport
rev: 0.16.1
rev: 1.0.0
hooks:
- id: unimport

- repo: https://github.com/PyCQA/docformatter
rev: v1.5.1
rev: v1.7.3
hooks:
- id: docformatter
args: [--config=pyproject.toml]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
rev: v1.4.1
hooks:
- id: mypy
additional_dependencies: [types-toml==0.1.3]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
rev: v3.0.0
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
Expand All @@ -41,15 +41,15 @@ repos:
files: "\\.(py|.txt|.yaml|.json|.in|.md|.toml|.cfg|.html|.yml)$"

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.8.0
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/hakancelikdev/pyall
rev: 00a95e9fe84d9dede21c750b8edf40336ba03b3e
- repo: https://github.com/hakancelikdev/unexport
rev: 0.4.0
hooks:
- id: pyall
- id: unexport
args:
- --refactor
- --exclude=tests|setup.py|__init__.py|
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
runs:
using: "composite"
steps:
- run: pip install --upgrade pip && python -m pip install unimport==0.16.1
- run: pip install --upgrade pip && python -m pip install unimport==1.0.0
shell: bash
- run: unimport --color auto --gitignore --ignore-init ${{ inputs.extra_args }}
shell: bash
Expand Down
26 changes: 26 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ All notable changes to this project will be documented in this file.

## [Unreleased] - YYYY-MM-DD

## [1.0.0] - 2023-07-07

### Added

- Automatically pick up config options from setup.cfg if it is present in the project
root else check and if it exists use pyproject.toml.
[#256](https://github.com/hakancelikdev/unimport/issues/256)

If you want you can disable this feature by passing `--disable-auto-discovery-config`

- Add github-action [#229](https://github.com/hakancelikdev/unimport/issues/229)
- Add support like command line commands in configuration files. #287

### Fixed

- ignore-init setting is not working from command line call
[#263](https://github.com/hakancelikdev/unimport/issues/263)
- Running without options or a config file
[#281](https://github.com/hakancelikdev/unimport/issues/281)
- Attribute as import refactor #284

### Changed

- Raise more human-readable exceptions when the key is mistyped in the configuration
[#286](https://github.com/hakancelikdev/unimport/issues/286)

## [0.16.1] - 2023-07-05

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ process with Unimport.

- **Documentation** https://unimport.hakancelik.dev/
- **Issues** https://github.com/hakancelikdev/unimport/issues/
- **Changelog** https://unimport.hakancelik.dev/CHANGELOG/
- **Changelog** https://unimport.hakancelik.dev/1.0.0/CHANGELOG/
- **Playground** https://playground-unimport.hakancelik.dev/
10 changes: 5 additions & 5 deletions docs/tutorial/use-with-github-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v3.5.3
- uses: actions/setup-python@v4.6.1
- name: Check unused imports
uses: hakancelikdev/unimport@stable
with:
Expand All @@ -24,10 +24,10 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v3.5.3
- uses: actions/setup-python@v4.6.1
- name: Check unused imports
uses: hakancelikdev/unimport@0.16.1
uses: hakancelikdev/unimport@1.0.0
with:
extra_args: --include src/
```
1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ markdown_extensions:
plugins:
- search:
separator: '[\s\-\.]+'
prebuild_index: true
- git-revision-date-localized:
type: date
enable_creation_date: true
Expand Down
15 changes: 8 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers =
project_urls =
Documentation = https://unimport.hakancelik.dev/
Issues = https://github.com/hakancelikdev/unimport/issues/
Changelog = https://unimport.hakancelik.dev/CHANGELOG/
Changelog = https://unimport.hakancelik.dev/1.0.0/CHANGELOG/

[options]
python_requires = >=3.6
Expand All @@ -56,16 +56,17 @@ console_scripts =

[options.extras_require]
docs =
mkdocs==1.4.2
mkdocs-material==8.5.11
mkdocs==1.4.3
mkdocs-material==9.1.18
mkdocs-markdownextradata-plugin==0.2.5
mkdocs-minify-plugin==0.6.2
mkdocs-git-revision-date-localized-plugin==1.1.0
mkdocs-minify-plugin==0.6.4
mkdocs-git-revision-date-localized-plugin==1.2.0
mike==1.1.2
test =
pytest==6.2.4; python_version == '3.6'
pytest==7.2.0; python_version != '3.6'
pytest-cov==4.0.0
pytest==7.4.0; python_version != '3.6'
pytest-cov==4.0.0; python_version == '3.6'
pytest-cov==4.1.0; python_version != '3.6'
semantic-version==2.10.0

[options.package_data]
Expand Down
2 changes: 1 addition & 1 deletion src/unimport/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.16.1"
__version__ = "1.0.0"
__description__ = "A linter, formatter for finding and removing unused import statements."
6 changes: 2 additions & 4 deletions src/unimport/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ class MakeSingletonWithParams(type):
_instances: Dict = {}

def __call__(cls, *args, **kwargs):
"""
Returns the same instance if args and kwargs are the same,
otherwise, creates a new instance.
"""
"""Returns the same instance if args and kwargs are the same,
otherwise, creates a new instance."""
key = (cls, args, frozenset(kwargs.items()))
if key not in cls._instances:
cls._instances[key] = super().__call__(*args, **kwargs)
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
def reopenable_temp_file(content: str, newline: Optional[str] = None) -> Iterator[Path]:
"""Create a reopenable tempfile to supporting multiple reads/writes.
Required to avoid file locking issues on Windows.
For more information, see:
Required to avoid file locking issues on Windows. For more
information, see:
https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile
:param content: string content to write.
Expand Down

0 comments on commit 7e28d68

Please sign in to comment.