Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e6c56bf758 | |||
| 7c2c635ca5 | |||
| 1556473336 | |||
| 96211ecca1 | |||
| 382fe6b1e9 | |||
| 37d100cd1c | |||
| b24b3f44fd | |||
| 935b5e5039 | |||
| 362a980510 | |||
| 926c86ea6f | |||
| 9ec7a07619 |
@@ -11,9 +11,44 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
- run: pip install -e ".[dev]"
|
|
||||||
- run: pytest tests/ -v
|
- name: Install dependencies
|
||||||
- run: ruff check src/ tests/
|
run: |
|
||||||
|
pip install -e ".[test]"
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: PYTHONPATH=src:$PYTHONPATH pytest tests/unit/ tests/integration/ -v --tb=short
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Install linting tools
|
||||||
|
run: pip install ruff>=0.1.0
|
||||||
|
|
||||||
|
- name: Run ruff linter
|
||||||
|
run: ruff check src/depcheck/
|
||||||
|
|
||||||
|
type-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Install type checker
|
||||||
|
run: pip install mypy>=1.0.0
|
||||||
|
|
||||||
|
- name: Run mypy type checker
|
||||||
|
run: mypy src/depcheck/ --ignore-missing-imports
|
||||||
|
|||||||
@@ -9,8 +9,13 @@ description = "A CLI tool that monitors outdated dependencies across multiple pa
|
|||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.9"
|
requires-python = ">=3.9"
|
||||||
license = {text = "MIT"}
|
license = {text = "MIT"}
|
||||||
|
authors = [
|
||||||
|
{name = "Depcheck Contributors"}
|
||||||
|
]
|
||||||
|
keywords = ["cli", "dependency", "security", "cve", "monitoring"]
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Development Status :: 4 - Beta",
|
"Development Status :: 4 - Beta",
|
||||||
|
"Environment :: Console",
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
@@ -18,6 +23,8 @@ classifiers = [
|
|||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3.12",
|
"Programming Language :: Python :: 3.12",
|
||||||
|
"Topic :: Software Development :: Testing",
|
||||||
|
"Topic :: Security",
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"click>=8.1.7",
|
"click>=8.1.7",
|
||||||
@@ -29,7 +36,7 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
dev = [
|
test = [
|
||||||
"pytest>=7.4.0",
|
"pytest>=7.4.0",
|
||||||
"pytest-cov>=4.1.0",
|
"pytest-cov>=4.1.0",
|
||||||
]
|
]
|
||||||
@@ -37,6 +44,9 @@ dev = [
|
|||||||
[project.scripts]
|
[project.scripts]
|
||||||
depcheck = "depcheck.cli:main"
|
depcheck = "depcheck.cli:main"
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
include = ["depcheck*"]
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
testpaths = ["tests"]
|
testpaths = ["tests"]
|
||||||
python_files = ["test_*.py"]
|
python_files = ["test_*.py"]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from depcheck.models import Dependency, PackageManager, ScanResult, Severity, Vu
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def temp_dir():
|
def temp_dir():
|
||||||
"""Create a temporary directory for tests."""
|
"""Create a temporary directory."""
|
||||||
with tempfile.TemporaryDirectory() as tmpdir:
|
with tempfile.TemporaryDirectory() as tmpdir:
|
||||||
yield tmpdir
|
yield tmpdir
|
||||||
|
|
||||||
@@ -20,14 +20,14 @@ def temp_dir():
|
|||||||
def sample_package_json():
|
def sample_package_json():
|
||||||
"""Create a sample package.json file content."""
|
"""Create a sample package.json file content."""
|
||||||
return """{
|
return """{
|
||||||
\"name\": \"test-project\",
|
"name": "test-project",
|
||||||
\"version\": \"1.0.0\",
|
"version": "1.0.0",
|
||||||
\"dependencies\": {
|
"dependencies": {
|
||||||
\"express\": \"4.18.2\",
|
"express": "4.18.2",
|
||||||
\"lodash\": \"4.17.20\"
|
"lodash": "4.17.20"
|
||||||
},
|
},
|
||||||
\"devDependencies\": {
|
"devDependencies": {
|
||||||
\"jest\": \"29.7.0\"
|
"jest": "29.7.0"
|
||||||
}
|
}
|
||||||
}"""
|
}"""
|
||||||
|
|
||||||
@@ -61,13 +61,13 @@ def sample_cargo_toml():
|
|||||||
"""Create a sample Cargo.toml file content."""
|
"""Create a sample Cargo.toml file content."""
|
||||||
return """
|
return """
|
||||||
[package]
|
[package]
|
||||||
name = \"my-project\"
|
name = "my-project"
|
||||||
version = \"0.1.0\"
|
version = "0.1.0"
|
||||||
edition = \"2021\"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = \"1.0\"
|
serde = "1.0"
|
||||||
tokio = \"1.36\"
|
tokio = "1.36"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ class TestNpmParser:
|
|||||||
def test_parse_simple_package_json(self):
|
def test_parse_simple_package_json(self):
|
||||||
"""Test parsing a simple package.json."""
|
"""Test parsing a simple package.json."""
|
||||||
content = """{
|
content = """{
|
||||||
\"name\": \"test-project\",
|
"name": "test-project",
|
||||||
\"version\": \"1.0.0\",
|
"version": "1.0.0",
|
||||||
\"dependencies\": {
|
"dependencies": {
|
||||||
\"express\": \"4.18.2\",
|
"express": "4.18.2",
|
||||||
\"lodash\": \"4.17.21\"
|
"lodash": "4.17.21"
|
||||||
}
|
}
|
||||||
}"""
|
}"""
|
||||||
|
|
||||||
@@ -42,10 +42,10 @@ class TestNpmParser:
|
|||||||
def test_parse_dev_dependencies(self):
|
def test_parse_dev_dependencies(self):
|
||||||
"""Test parsing devDependencies."""
|
"""Test parsing devDependencies."""
|
||||||
content = """{
|
content = """{
|
||||||
\"name\": \"test-project\",
|
"name": "test-project",
|
||||||
\"devDependencies\": {
|
"devDependencies": {
|
||||||
\"jest\": \"29.7.0\",
|
"jest": "29.7.0",
|
||||||
\"eslint\": \"8.56.0\"
|
"eslint": "8.56.0"
|
||||||
}
|
}
|
||||||
}"""
|
}"""
|
||||||
|
|
||||||
@@ -62,8 +62,8 @@ class TestNpmParser:
|
|||||||
def test_parse_optional_dependencies(self):
|
def test_parse_optional_dependencies(self):
|
||||||
"""Test parsing optionalDependencies."""
|
"""Test parsing optionalDependencies."""
|
||||||
content = """{
|
content = """{
|
||||||
\"optionalDependencies\": {
|
"optionalDependencies": {
|
||||||
\"fsevents\": \"2.3.3\"
|
"fsevents": "2.3.3"
|
||||||
}
|
}
|
||||||
}"""
|
}"""
|
||||||
|
|
||||||
@@ -184,16 +184,16 @@ class TestCargoParser:
|
|||||||
"""Test parsing Cargo.toml file."""
|
"""Test parsing Cargo.toml file."""
|
||||||
content = """
|
content = """
|
||||||
[package]
|
[package]
|
||||||
name = \"my-project\"
|
name = "my-project"
|
||||||
version = \"0.1.0\"
|
version = "0.1.0"
|
||||||
edition = \"2021\"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = \"1.0\"
|
serde = "1.0"
|
||||||
tokio = \"1.36\"
|
tokio = "1.36"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
proptest = \"1.4\"
|
proptest = "1.4"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory() as tmpdir:
|
with tempfile.TemporaryDirectory() as tmpdir:
|
||||||
|
|||||||
Reference in New Issue
Block a user