diff --git a/.gitignore b/.gitignore index e1a3186..19e0f43 100644 --- a/.gitignore +++ b/.gitignore @@ -496,9 +496,6 @@ poetry.toml # ruff .ruff_cache/ -# LSP config files -pyrightconfig.json - ### SublimeText ### # Cache files for Sublime Text *.tmlanguage.cache diff --git a/.pyflybygen-copier-answers.yml b/.{{package_name}}-copier-answers.yml similarity index 100% rename from .pyflybygen-copier-answers.yml rename to .{{package_name}}-copier-answers.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d9836c..eb014a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,3 @@ -## 0.1.0 - -- feat ignore files in .gitignore -- feat `--relative-imports` flag - ## 0.0.0 init diff --git a/README.md b/README.md index 6141d67..a81e53d 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ Generates pyflyby configurations for your project based on existing imports. -[![PyPI - Version](https://img.shields.io/pypi/v/pyflybygen.svg)](https://pypi.org/project/pyflybygen) -[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyflybygen.svg)](https://pypi.org/project/pyflybygen) +[![PyPI - Version](https://img.shields.io/pypi/v/{{ package_name }}.svg)](https://pypi.org/project/{{ package_name }}) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/{{ package_name }}.svg)](https://pypi.org/project/{{ package_name }}) --- diff --git a/pyflybygen/__about__.py b/pyflybygen/__about__.py index fbb820c..6d1bde0 100644 --- a/pyflybygen/__about__.py +++ b/pyflybygen/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2023-present Waylon S. Walker # # SPDX-License-Identifier: MIT -__version__ = "0.2.0.dev1" +__version__ = "0.0.0" diff --git a/pyflybygen/cli/app.py b/pyflybygen/cli/app.py index 2592fcd..300b39b 100644 --- a/pyflybygen/cli/app.py +++ b/pyflybygen/cli/app.py @@ -1,7 +1,6 @@ from pathlib import Path import more_itertools -import pathspec import typer from pyflybygen.cli.common import verbose_callback @@ -49,20 +48,10 @@ def main( callback=verbose_callback, help="show the log messages", ), - relative_imports: bool = typer.Option( - False, - help="include relative imports", - ), ) -> None: - lines = [] - if Path(".gitignore").exists(): - lines.extend(Path(".gitignore").read_text().splitlines()) - spec = pathspec.PathSpec.from_lines("gitwildmatch", lines) - files = Path(".").glob("**/*.py") - files = [file for file in files if not spec.match_file(str(file))] - imports = more_itertools.flatten([get_imports(p.read_text()) for p in files]) - if not relative_imports: - imports = [i for i in imports if "from ." not in i] + imports = more_itertools.flatten( + [get_imports(p.read_text()) for p in Path(".").glob("**/*.py")] + ) print("\n".join(set(imports))) diff --git a/pyproject.toml b/pyproject.toml index 012e08c..8db8537 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,8 @@ dependencies = [ "anyconfig", "tree_sitter_languages", 'more_itertools', - 'pathspec', + 'coverage', + 'coverage-rich', ] dynamic = ["version"] @@ -57,8 +58,6 @@ dependencies = [ "pytest-rich", "ruff", "black", - 'coverage', - 'coverage-rich', ] [tool.hatch.envs.default.scripts] test = "coverage run -m pytest" diff --git a/tmp.py b/tmp.py index fb6bacf..7f7b969 100644 --- a/tmp.py +++ b/tmp.py @@ -1,7 +1,5 @@ from pathlib import Path -from .pyflybygen import pyflybygen - statements = """ from __future__ import (absolute_import, division)