Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4f1f944
Add support for parsing nginx config strings
dvershinin Oct 25, 2025
bb76776
Add documentation for crossplane.parse_string() and crossplane.lex_st…
dvershinin Oct 25, 2025
7219dae
Fix EOF lexing for unterminated directives
dvershinin Dec 26, 2025
5bc1c0f
Make build() accept parse payload input
dvershinin Dec 26, 2025
c905627
Merge pull request #1 from dvershinin/fix/lexer-eof-114
dvershinin Dec 26, 2025
c423e00
Address review feedback for build() payload handling
dvershinin Dec 26, 2025
8ff4714
CI: run tests on pull requests
dvershinin Dec 26, 2025
ecc58eb
CI+pre-commit: add py36 checks
dvershinin Dec 26, 2025
425de36
Pre-commit: add hooks and run py36 tests
dvershinin Dec 26, 2025
2977180
Pre-commit: remove hardcoded paths
dvershinin Dec 26, 2025
4caa769
Merge pull request #2 from dvershinin/fix/build-accept-parse-payload-110
dvershinin Dec 26, 2025
f299319
Release workflows for PyPI (crossplane-ng) and Docker image
dvershinin Dec 26, 2025
4add46d
Gated release: run tests, create GitHub Release, publish to PyPI and …
dvershinin Dec 26, 2025
8af2953
Release workflow: only publish on v* tags
dvershinin Dec 26, 2025
72f3586
Release 0.5.8
dvershinin Dec 26, 2025
f2a4688
Rename distribution to nginx-crossplane (PyPI)
dvershinin Dec 26, 2025
d14e930
Fix setup.py metadata parsing for PEP 517 editable installs
dvershinin Dec 26, 2025
71276ca
CI: run py36 tests in container; release 0.5.11
dvershinin Dec 26, 2025
973f0ca
Fix pyproject build requirements for Python 3.6; release 0.5.12
dvershinin Dec 26, 2025
c802194
Publish Docker image to GHCR
dvershinin Dec 26, 2025
f146d52
GHCR image name: ghcr.io/dvershinin/crossplane
dvershinin Dec 26, 2025
5b1a099
Rename PyPI package to ngxparse; release 0.5.15
dvershinin Jan 29, 2026
99fec75
Fix variable scope leak and add map/types strict mode support
dvershinin Jan 29, 2026
01211f9
fix: properly tokenize whitespace after braced variables
dvershinin Jan 29, 2026
028329b
Fix bugs, typos, and expand test coverage
dvershinin Jan 31, 2026
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
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.git
.github
.tox
.venv
build
dist
crossplane.egg-info
tests
ext
__pycache__
*.pyc
*.pyo
*.pyd

44 changes: 38 additions & 6 deletions .github/workflows/crossplane-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name: Crossplane CI
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '**.md'
pull_request:
branches:
- master
paths-ignore:
- '**.md'

Expand All @@ -12,15 +19,40 @@ jobs:

strategy:
matrix:
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", pypy-3.6, pypy-3.7, pypy-3.8, pypy-3.9]
# Keep this matrix to runtimes supported by GitHub-hosted runners.
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run tox under Python ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install pytest
- name: Run tests
run: |
python -m pytest -q

test-py36:
name: Tests (Python 3.6)
# GitHub-hosted ubuntu-20.04 runners may be unavailable/deprecated.
# Run Py3.6 tests via a container on a supported runner instead.
runs-on: ubuntu-latest
container:
image: python:3.6-buster

steps:
- uses: actions/checkout@v4
- name: Install dependencies (Python 3.6)
run: |
python -m pip install --upgrade "pip<22" "setuptools<60" wheel
python -m pip install -e .
python -m pip install "pytest<8"
- name: Run tests (Python 3.6)
run: |
pip install tox
tox -e py
python -m pytest -q
179 changes: 179 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
name: Release

on:
push:
tags:
- "v*"
workflow_dispatch:

jobs:
test:
name: Tests
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install pytest
- name: Run tests
run: |
python -m pytest -q

test-py36:
name: Tests (Python 3.6)
# GitHub-hosted ubuntu-20.04 runners may be unavailable/deprecated.
# Run Py3.6 tests via a container on a supported runner instead.
runs-on: ubuntu-latest
container:
image: python:3.6-buster

steps:
- uses: actions/checkout@v4
- name: Install dependencies (Python 3.6)
run: |
python -m pip install --upgrade "pip<22" "setuptools<60" wheel
python -m pip install -e .
python -m pip install "pytest<8"
- name: Run tests (Python 3.6)
run: |
python -m pytest -q

build:
name: Build distributions
runs-on: ubuntu-latest
needs: [test, test-py36]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build distributions
run: |
python -m pip install --upgrade pip build
python -m build

- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*

github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [build]
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true

pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [github-release]
if: startsWith(github.ref, 'refs/tags/v')

steps:
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Upload to PyPI (twine)
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install --upgrade twine
python -m twine upload --non-interactive dist/*

docker:
name: Build & push Docker image
runs-on: ubuntu-latest
needs: [github-release]
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: read
packages: write

env:
DOCKERHUB_IMAGE_NAME: ngxparse
GHCR_IMAGE_NAME: ngxparse

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry (GHCR)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKER_USERNAME }}/${{ env.DOCKERHUB_IMAGE_NAME }}
ghcr.io/${{ github.repository_owner }}/${{ env.GHCR_IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64


67 changes: 67 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Pre-commit hooks for crossplane (mirrors ~/Projects/gixy style)
# See https://pre-commit.com for more information

repos:
# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- id: debug-statements

# Ruff for linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# crossplane is a legacy codebase with Python 2 compatibility shims;
# limit ruff to scripts to avoid a massive reformat/lint-only migration.
files: ^scripts/.*\.py$
- id: ruff-format
files: ^scripts/.*\.py$

# Bandit for security scanning
- repo: https://github.com/PyCQA/bandit
rev: 1.7.10
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]
# Bandit is useful on our own scripts; the main package has known
# false positives (e.g. B105 on token buffers) and legacy patterns.
files: ^scripts/.*\.py$

# Local hooks
- repo: local
hooks:
# Check for hardcoded IPs (similar to SonarCloud S1313)
- id: check-hardcoded-ips
name: Check for hardcoded IP addresses
description: Catches hardcoded IPs that SonarCloud would flag
entry: python3 scripts/check_hardcoded_ips.py
language: system
types: [python]

# Run full tests on Python 3.6 before commit (mirrors gixy)
- id: pytest-py36
name: Run tests on Python 3.6
description: Full test suite on minimum supported Python
# Use CROSSPLANE_PY36 to override the interpreter path if needed.
entry: bash -c '"${CROSSPLANE_PY36:-${PYENV_ROOT:-$HOME/.pyenv}/versions/3.6.15/bin/python}" -m pytest tests/ -q --tb=line'
language: system
pass_filenames: false
files: ^(crossplane/.*\.py|tests/.*\.py)$
stages: [pre-commit]

# Prevent committing hardcoded absolute local paths (e.g. /Users/<name>/...)
- id: check-absolute-paths
name: Check for hardcoded absolute paths
description: Prevent committing absolute dev-machine paths (macOS/Linux/Windows home dirs)
entry: python3 scripts/check_absolute_paths.py
language: system
files: \.(py|ya?ml|toml)$
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Contributors
* Ivan Poluyanov <i.poluyanov@icloud.com> `@poluyanov <https://github.com/poluyanov>`_
* Raymond Lau <raymond.lau.ca@gmail.com> `@Raymond26 <https://github.com/Raymond26>`_
* Luca Comellini <luca.com@gmail.com> `@lucacome <https://github.com/lucacome>`_
* Ron Vider <viderron@gmail.com> `@RonVider <https://github.com/RonVider>`_
* Ron Vider <viderron@gmail.com> `@RonVider <https://github.com/RonVider>`_
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/).

## [0.5.15] - 2026-01-29

### Changed
- PyPI package renamed from `nginx-crossplane` to `ngxparse` for a shorter name that doesn't imply nginx is bundled.
- Docker image names changed to `ngxparse` on both Docker Hub and GHCR.

### Migration
```bash
pip uninstall nginx-crossplane
pip install ngxparse
# import crossplane # unchanged
# crossplane parse # CLI unchanged
```

## [0.5.8] - 2025-12-26

### Added
- GitHub Actions release workflow gated on tests that:
- builds and attaches `sdist`/`wheel` artifacts to a GitHub Release
- publishes the distribution to PyPI
- builds and pushes a multi-arch Docker image running the `crossplane` CLI

### Changed
- PyPI distribution name differs from the import/CLI name (`crossplane`).
- Packaging no longer imports `crossplane` during builds to avoid import-time side effects.

## [0.5.9] - 2025-12-26

### Changed
- Renamed PyPI distribution to `nginx-crossplane` (because `crossplane-ng` is already taken by another fork: `https://github.com/qosmio/crossplane`).

## [0.5.10] - 2025-12-26

### Fixed
- Packaging: fix metadata parsing in `setup.py` so editable installs work in CI (PEP 517/660).

## [0.5.11] - 2025-12-26

### Fixed
- CI: run Python 3.6 tests in a `python:3.6` container on `ubuntu-latest` (avoid `ubuntu-20.04` runner queue/hangs).

## [0.5.12] - 2025-12-26

### Fixed
- CI/Packaging: `pyproject.toml` build-system requirements now use env markers so Python 3.6 doesn't try to install `setuptools>=61`.

## [0.5.13] - 2025-12-26

### Added
- Docker image publishing to GitHub Container Registry (GHCR) in addition to Docker Hub.

## [0.5.14] - 2025-12-26

### Changed
- GHCR image name is now `ghcr.io/dvershinin/crossplane` (Docker Hub remains `${DOCKER_USERNAME}/nginx-crossplane`).


Loading