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
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- run: pip install -e ".[dev]"
|
||||
- run: pytest tests/ -v
|
||||
- run: ruff check src/ tests/
|
||||
|
||||
- name: Install dependencies
|
||||
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"
|
||||
requires-python = ">=3.9"
|
||||
license = {text = "MIT"}
|
||||
authors = [
|
||||
{name = "Depcheck Contributors"}
|
||||
]
|
||||
keywords = ["cli", "dependency", "security", "cve", "monitoring"]
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Environment :: Console",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
@@ -18,6 +23,8 @@ classifiers = [
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Topic :: Software Development :: Testing",
|
||||
"Topic :: Security",
|
||||
]
|
||||
dependencies = [
|
||||
"click>=8.1.7",
|
||||
@@ -29,7 +36,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
test = [
|
||||
"pytest>=7.4.0",
|
||||
"pytest-cov>=4.1.0",
|
||||
]
|
||||
@@ -37,6 +44,9 @@ dev = [
|
||||
[project.scripts]
|
||||
depcheck = "depcheck.cli:main"
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
include = ["depcheck*"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
python_files = ["test_*.py"]
|
||||
|
||||
@@ -11,7 +11,7 @@ from depcheck.models import Dependency, PackageManager, ScanResult, Severity, Vu
|
||||
|
||||
@pytest.fixture
|
||||
def temp_dir():
|
||||
"""Create a temporary directory for tests."""
|
||||
"""Create a temporary directory."""
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
yield tmpdir
|
||||
|
||||
@@ -20,14 +20,14 @@ def temp_dir():
|
||||
def sample_package_json():
|
||||
"""Create a sample package.json file content."""
|
||||
return """{
|
||||
\"name\": \"test-project\",
|
||||
\"version\": \"1.0.0\",
|
||||
\"dependencies\": {
|
||||
\"express\": \"4.18.2\",
|
||||
\"lodash\": \"4.17.20\"
|
||||
"name": "test-project",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"express": "4.18.2",
|
||||
"lodash": "4.17.20"
|
||||
},
|
||||
\"devDependencies\": {
|
||||
\"jest\": \"29.7.0\"
|
||||
"devDependencies": {
|
||||
"jest": "29.7.0"
|
||||
}
|
||||
}"""
|
||||
|
||||
@@ -61,13 +61,13 @@ def sample_cargo_toml():
|
||||
"""Create a sample Cargo.toml file content."""
|
||||
return """
|
||||
[package]
|
||||
name = \"my-project\"
|
||||
version = \"0.1.0\"
|
||||
edition = \"2021\"
|
||||
name = "my-project"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
serde = \"1.0\"
|
||||
tokio = \"1.36\"
|
||||
serde = "1.0"
|
||||
tokio = "1.36"
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ class TestNpmParser:
|
||||
def test_parse_simple_package_json(self):
|
||||
"""Test parsing a simple package.json."""
|
||||
content = """{
|
||||
\"name\": \"test-project\",
|
||||
\"version\": \"1.0.0\",
|
||||
\"dependencies\": {
|
||||
\"express\": \"4.18.2\",
|
||||
\"lodash\": \"4.17.21\"
|
||||
"name": "test-project",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"express": "4.18.2",
|
||||
"lodash": "4.17.21"
|
||||
}
|
||||
}"""
|
||||
|
||||
@@ -42,10 +42,10 @@ class TestNpmParser:
|
||||
def test_parse_dev_dependencies(self):
|
||||
"""Test parsing devDependencies."""
|
||||
content = """{
|
||||
\"name\": \"test-project\",
|
||||
\"devDependencies\": {
|
||||
\"jest\": \"29.7.0\",
|
||||
\"eslint\": \"8.56.0\"
|
||||
"name": "test-project",
|
||||
"devDependencies": {
|
||||
"jest": "29.7.0",
|
||||
"eslint": "8.56.0"
|
||||
}
|
||||
}"""
|
||||
|
||||
@@ -62,8 +62,8 @@ class TestNpmParser:
|
||||
def test_parse_optional_dependencies(self):
|
||||
"""Test parsing optionalDependencies."""
|
||||
content = """{
|
||||
\"optionalDependencies\": {
|
||||
\"fsevents\": \"2.3.3\"
|
||||
"optionalDependencies": {
|
||||
"fsevents": "2.3.3"
|
||||
}
|
||||
}"""
|
||||
|
||||
@@ -184,16 +184,16 @@ class TestCargoParser:
|
||||
"""Test parsing Cargo.toml file."""
|
||||
content = """
|
||||
[package]
|
||||
name = \"my-project\"
|
||||
version = \"0.1.0\"
|
||||
edition = \"2021\"
|
||||
name = "my-project"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
serde = \"1.0\"
|
||||
tokio = \"1.36\"
|
||||
serde = "1.0"
|
||||
tokio = "1.36"
|
||||
|
||||
[dev-dependencies]
|
||||
proptest = \"1.4\"
|
||||
proptest = "1.4"
|
||||
"""
|
||||
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
|
||||
Reference in New Issue
Block a user