Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .['test']
python -m pip install .['dev']
- name: Run mypy
run: |
mypy ./iscan/
Expand Down
12 changes: 5 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
repos:
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.10
hooks:
- id: flake8
- repo: https://github.com/timothycrosley/isort
rev: 5.1.0
hooks:
- id: isort
- id: ruff
args: [--fix]
- id: ruff-format
2 changes: 1 addition & 1 deletion iscan/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from iscan.scan import run


__version__ = '0.4.5'
__version__ = '0.4.6'
4 changes: 3 additions & 1 deletion iscan/std_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ def get_std_lib(version: str) -> List[str]:
resp.raise_for_status()

soup = BeautifulSoup(resp.text, 'html.parser')
links = soup.find('table').find_all('a', href=True)
table = soup.find('table')
assert table is not None
links = table.find_all('a', href=True)
std_lib = [link.text.split('.')[0] for link in links]

return sorted(set(std_lib))
Expand Down
7 changes: 3 additions & 4 deletions iscan/tests/test_package/foo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Import two packages on a single line to see if it breaks the code.
isort:skip_file
"""
"""Import third-party packages to test scanning behaviour."""
import shutil

import matplotlib.pyplot as plt
import numpy as np, pandas as pd # noqa: E401
import numpy as np
import pandas as pd
3 changes: 1 addition & 2 deletions iscan/tests/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

import pytest

from iscan.scan import (ImportScanner, convert_source_to_tree, get_base_name,
run, scan_directory, sort_counter)
from iscan.scan import ImportScanner, convert_source_to_tree, get_base_name, run, scan_directory, sort_counter


CURRENT_DIR = abspath(dirname(__file__))
Expand Down
2 changes: 0 additions & 2 deletions mypy.ini

This file was deleted.

50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

[project]
name = "iscan"
dynamic = ["version"]
description = "iscan helps you identify your project's dependencies."
readme = "README.md"
requires-python = ">=3.10"
license = {file = "LICENSE"}
authors = [
{name = "Zhengnan Zhao"}
]
classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
urls.Repository = "https://github.com/zzhengnan/iscan"
scripts.iscan = "iscan.scan:main"
optional-dependencies.build = ["setuptools", "twine", "wheel"]
optional-dependencies.dev = [
"beautifulsoup4",
"coverage",
"mypy",
"pre-commit",
"pytest",
"requests",
"ruff",
]

[tool.setuptools.dynamic]
version = {attr = "iscan.__version__"}

[tool.ruff]
line-length = 120
exclude = ["build", "dist", "iscan/std_lib.py"]
lint.select = ["E", "F", "I"]
lint.ignore = ["F401"]
lint.isort.known-first-party = ["iscan"]
lint.isort.lines-between-types = 0
lint.isort.lines-after-imports = 2

[tool.mypy]
overrides = [{module = "iscan.tests.*", ignore_errors = true}]
12 changes: 0 additions & 12 deletions setup.cfg

This file was deleted.

40 changes: 0 additions & 40 deletions setup.py

This file was deleted.

Loading