diff --git a/.github/workflows/run-type-enforcer.yml b/.github/workflows/run-type-enforcer.yml new file mode 100644 index 00000000..01a1cf7e --- /dev/null +++ b/.github/workflows/run-type-enforcer.yml @@ -0,0 +1,32 @@ +name: Run Type Enforcer + +on: + push: + branches: + - main + paths: + - "**.py" + pull_request: + +permissions: + contents: read + +jobs: + type-safety: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5.4.0 + with: + python-version: "3.12" + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Type checker + run: mypy . --strict diff --git a/flake.lock b/flake.lock index 7f83f7a4..fe26ae69 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1739923778, - "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=", + "lastModified": 1742388435, + "narHash": "sha256-GheQGRNYAhHsvPxWVOhAmg9lZKkis22UPbEHlmZMthg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1", + "rev": "b75693fb46bfaf09e662d09ec076c5a162efa9f6", "type": "github" }, "original": { @@ -37,11 +37,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1739758351, - "narHash": "sha256-Aoa4dEoC7Hf6+gFVk/SDquZTMFlmlfsgdTWuqQxzePs=", + "lastModified": 1742471416, + "narHash": "sha256-Feo4W3kcJfEDnPfZdh0pt9SnMFCHBAukEDBZClEhe+Q=", "owner": "nix-community", "repo": "pyproject.nix", - "rev": "1329712f7f9af3a8b270764ba338a455b7323811", + "rev": "e6195836ac5d3d0e0c0c1a523afcf39f05554d20", "type": "github" }, "original": { diff --git a/pyproject.toml b/pyproject.toml index d8fbb0c6..ba8df2b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ readme = "README.md" requires-python = ">=3.12" keywords = [ "software supply chain", "ssc", "dependencies", "npm",] classifiers = [ "Intended Audience :: Developers", "Topic :: Software Development :: Build Tools", "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent",] -dependencies = [ "attrs ==25.3.0", "cattrs == 24.1.2", "certifi ==2025.1.31", "charset-normalizer ==3.4.1", "exceptiongroup == 1.2.2", "GitPython ==3.1.44", "idna == 3.10", "markdown-it-py == 3.0.0", "numpy ==2.2.4", "pandas == 2.2.3", "platformdirs == 4.3.6", "pytest ==8.3.5", "python-dateutil == 2.9.0.post0", "pytz ==2025.1", "PyYAML == 6.0.2", "requests == 2.32.3", "requests-cache == 1.2.1", "six ==1.17.0", "tabulate == 0.9.0", "tqdm ==4.67.1", "typing_extensions == 4.12.2", "tzdata ==2025.1", "url-normalize == 1.4.3", "urllib3 ==2.3.0", "xmltodict == 0.14.2",] +dependencies = [ "attrs ==25.3.0", "cattrs == 24.1.2", "certifi ==2025.1.31", "charset-normalizer ==3.4.1", "exceptiongroup == 1.2.2", "GitPython ==3.1.44", "idna == 3.10", "markdown-it-py == 3.0.0", "mypy ==1.15.0", "numpy ==2.2.4", "pandas == 2.2.3", "platformdirs == 4.3.6", "pytest ==8.3.5", "python-dateutil == 2.9.0.post0", "pytz ==2025.1", "PyYAML == 6.0.2", "requests == 2.32.3", "requests-cache == 1.2.1", "six ==1.17.0", "tabulate == 0.9.0", "tqdm ==4.67.1", "typing_extensions == 4.12.2", "tzdata ==2025.1", "url-normalize == 1.4.3", "urllib3 ==2.3.0", "xmltodict == 0.14.2",] [[project.authors]] name = "Raphina Liu" email = "raphina@kth.se" diff --git a/requirements.txt b/requirements.txt index a12d0d88..8b9e524c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ exceptiongroup==1.2.2 GitPython==3.1.44 idna==3.10 markdown-it-py==3.0.0 +mypy==1.15.0 numpy==2.2.4 pandas==2.2.3 platformdirs==4.3.6