Skip to content
Closed
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
25 changes: 11 additions & 14 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.x"
- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
virtualenvs-create: false
- name: Update version (kept at 0.0.0) in pyproject.toml and build
enable-cache: false
- name: Set version and build
env:
RELEASE_VERSION: ${{ github.ref_name }}
run: |
poetry version ${{ github.ref_name }}
poetry build
- name: Mint token
id: mint
uses: tschm/token-mint-action@eef668ab210066f42abfe3f2af4e03ec24f30089 # v1.0.3
- name: Publish the package with poetry
run: |
poetry publish -u __token__ -p '${{ steps.mint.outputs.api-token }}'
uv version "${RELEASE_VERSION#v}"
uv build
- name: Publish to PyPI
run: uv publish --trusted-publishing always
18 changes: 8 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,21 @@ jobs:
strategy:
fail-fast: true
matrix:
poetry-version: ['2.2.1']
crsversion: ['4.23.0', '3.3.8', '3.2.1']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- name: "Checkout repo"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Python 3
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8 # v4
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
poetry-version: ${{ matrix.poetry-version }}
python-version: ${{ matrix.python-version }}
enable-cache: false
- name: "Run tests"
run: |
curl -L https://github.com/coreruleset/coreruleset/archive/refs/tags/v${{ matrix.crsversion }}.tar.gz -o - | tar xzvf - --strip-components=1 --wildcards "*/rules/*"
poetry install -v --with dev
poetry run pytest -vs
poetry run secrules-parser -c --output-type github -f rules/*.conf
uv sync
uv run pytest -vs
uv run secrules-parser -c --output-type github -f rules/*.conf
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ parser.get_correctness(files, models)

If you want to modify this module, follow these steps:
1. Clone this repository: `git clone git@github.com:coreruleset/secrules_parsing.git`
1. Do not forget to install dependencies using [poetry](https://python-poetry.org/docs/): `poetry install` first!
1. Do not forget to install dependencies using [uv](https://docs.astral.sh/uv/): `uv sync` first!
1. Edit and change the files you want.
1. Write tests! Tests are in the `tests` subdirectory
1. Create a PR [here](https://github.com/coreruleset/secrules_parsing/compare), and ask for review!
Expand Down
Loading
Loading