Skip to content
Merged
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
22 changes: 22 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.git/
.github/
.idea/
.venv/
.env

__pycache__/
*.py[cod]
*$py.class
.pytest_cache/
.coverage
coverage.xml
htmlcov/

build/
dist/
dist_native/
*.egg-info/

output_xml/
generated_xml/
_schemas/
10 changes: 5 additions & 5 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM python:3.13-slim

#RUN apt-get update && apt-get install -y clang-19 patchelf && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y build-essential patchelf && apt-get clean && rm -rf /var/lib/apt/lists/*
#RUN apt-get update && apt-get install -y clang-19 && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y build-essential && apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt .
COPY . .

RUN pip install --progress-bar off --no-cache-dir -r requirements.txt
RUN pip install --progress-bar off --no-cache-dir -e ".[build]"

ENTRYPOINT [ "python", "build_native.py" ]
ENTRYPOINT [ "python", "build_native.py" ]
25 changes: 21 additions & 4 deletions .github/workflows/_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
ref:
required: false
type: string
upload-codecov:
required: false
type: boolean
default: false

jobs:
test:
Expand All @@ -24,10 +28,23 @@ jobs:
with:
python-version: ${{ inputs.python-version }}
cache: 'pip'
cache-dependency-path: requirements.txt
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: pip install -r requirements.txt
run: pip install -e ".[test]"

- name: Run tests with coverage
run: pytest --cov=xmlgenerator --cov-report=term-missing --cov-report=xml

- name: Run tests with pytest
run: pytest
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ inputs.python-version }}
path: coverage.xml

- name: Upload coverage to Codecov
if: inputs.upload-codecov
uses: codecov/codecov-action@v5
with:
files: coverage.xml
fail_ci_if_error: false
39 changes: 18 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,28 @@ jobs:
with:
python-version: '3.14'
cache: 'pip'
cache-dependency-path: requirements.txt
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: pip install -r requirements.txt
run: pip install -e .

- name: Compare tag version with setup.py version
- name: Compare tag version with package version
id: check-version
run: |
# Extract version from tag (strip the leading 'v')
TAG_VERSION=${GITHUB_REF#refs/tags/v}
echo "Tag version: $TAG_VERSION"
# Read version from setup.py
SETUP_VERSION=$(python setup.py --version)
echo "Setup.py version: $SETUP_VERSION"

# Read version from the package metadata source
PACKAGE_VERSION=$(python -c "from xmlgenerator import __version__; print(__version__)")
echo "Package version: $PACKAGE_VERSION"

# Compare versions
if [ "$TAG_VERSION" = "$SETUP_VERSION" ]; then
echo "✅ Versions match: $TAG_VERSION = $SETUP_VERSION"
if [ "$TAG_VERSION" = "$PACKAGE_VERSION" ]; then
echo "✅ Versions match: $TAG_VERSION = $PACKAGE_VERSION"
echo "versions_match=true" >> $GITHUB_OUTPUT
else
echo "❌ Versions do not match: $TAG_VERSION ≠ $SETUP_VERSION"
echo "❌ Versions do not match: $TAG_VERSION ≠ $PACKAGE_VERSION"
echo "versions_match=false" >> $GITHUB_OUTPUT
exit 1
fi
Expand Down Expand Up @@ -113,16 +113,14 @@ jobs:
with:
python-version: '3.14'
cache: 'pip'
cache-dependency-path: requirements.txt
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install build setuptools
pip install build

- name: Build package
run: |
python setup.py sdist bdist_wheel
run: python -m build

- name: Upload package artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -166,10 +164,10 @@ jobs:
with:
python-version: ${{ matrix.python_ver }}
cache: 'pip'
cache-dependency-path: requirements.txt
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: pip install -r requirements.txt
run: pip install -e ".[build]"

- name: Build native
id: build_native
Expand Down Expand Up @@ -260,12 +258,11 @@ jobs:
with:
python-version: '3.14'
cache: 'pip'
cache-dependency-path: requirements.txt
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install twine
pip install -e ".[build]"

- name: Download Python packages
uses: actions/download-artifact@v5
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ jobs:
uses: ./.github/workflows/_pytest.yml
with:
python-version: ${{ matrix.python-version }}
upload-codecov: ${{ matrix.python-version == '3.14' }}
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
/.idea/
/.venv/
/.env

__pycache__/
*.py[cod]
*$py.class
.pytest_cache/
.coverage
coverage.xml
htmlcov/

/output_xml/*
/generated_xml/
/build/
/dist/
/xmlgenerator.egg-info/
/*.egg-info/
/_schemas/
/dist_native/
/.roo/
/.roo/
3 changes: 1 addition & 2 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Configuring xmlgenerator

- [Русский 🇷🇺](./CONFIGURATION_RU.md)
- [English 🇺🇸](./CONFIGURATION.md)
[ [🇷🇺 Русский](CONFIGURATION_RU.md) ]

This guide will help you understand how to configure `xmlgenerator`.

Expand Down
3 changes: 1 addition & 2 deletions CONFIGURATION_RU.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Конфигурирование xmlgenerator

- [Русский 🇷🇺](./CONFIGURATION_RU.md)
- [English 🇺🇸](./CONFIGURATION.md)
[ [🇺🇸 English](CONFIGURATION.md) ]

Это руководство поможет вам понять, как настраивать `xmlgenerator`.

Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

[![PyPI - Version](https://img.shields.io/pypi/v/xmlgenerator)](https://pypi.org/project/xmlgenerator)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/xmlgenerator)](https://pypistats.org/packages/xmlgenerator)
[![Coverage](https://codecov.io/gh/lexakimov/xmlgenerator/branch/master/graph/badge.svg)](https://codecov.io/gh/lexakimov/xmlgenerator)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/lexakimov/xmlgenerator)

- [Русский 🇷🇺](README_RU.md)
- [English 🇺🇸](README.md)
[ [🇷🇺 Русский](README_RU.md) ]

Generates XML documents based on XSD schemas with the ability to customize data through a YAML configuration file.

Expand Down Expand Up @@ -61,7 +61,7 @@ options:
-p, --pretty prettify the output XML
-n, --namespace alias=namespace define XML namespace alias (repeatable flag)
-v, --validation <validation> validate the generated XML document (none, schema, schematron; default: schema)
-i continue execution when validation errors occur
-i, --ignore-errors continue execution when validation errors occur
-e, --encoding <encoding> the output XML encoding (utf-8, windows-1251; default: utf-8)
-s, --seed <seed> set the randomization seed
-d, --debug enable debug mode
Expand Down Expand Up @@ -132,9 +132,9 @@ Contributions are welcome! Please open an issue or submit a pull request on GitH
.\.venv\Scripts\activate
```

3. **Install dependencies:**
3. **Install the project with development dependencies:**
```bash
pip install -r requirements.txt
pip install -e ".[dev]"
```

4.1. **Install the package:**
Expand All @@ -153,9 +153,16 @@ Contributions are welcome! Please open an issue or submit a pull request on GitH
### Running Tests

```bash
pip install -e ".[test]"
pytest
```

Run tests with coverage:

```bash
pytest --cov=xmlgenerator --cov-report=term-missing --cov-report=html
```

---

## License
Expand Down
17 changes: 12 additions & 5 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

[![PyPI - Version](https://img.shields.io/pypi/v/xmlgenerator)](https://pypi.org/project/xmlgenerator)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/xmlgenerator)](https://pypistats.org/packages/xmlgenerator)
[![Coverage](https://codecov.io/gh/lexakimov/xmlgenerator/branch/master/graph/badge.svg)](https://codecov.io/gh/lexakimov/xmlgenerator)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/lexakimov/xmlgenerator)

- [Русский 🇷🇺](README_RU.md)
- [English 🇺🇸](README.md)
[ [🇺🇸 English](README.md) ]

Генерирует XML-документы на основе XSD-схем с возможностью настройки через конфигурационный YAML-файл.

Expand Down Expand Up @@ -61,7 +61,7 @@ options:
-p, --pretty prettify the output XML
-n, --namespace alias=namespace define XML namespace alias (repeatable flag)
-v, --validation <validation> validate the generated XML document (none, schema, schematron; default: schema)
-i continue execution when validation errors occur
-i, --ignore-errors continue execution when validation errors occur
-e, --encoding <encoding> the output XML encoding (utf-8, windows-1251; default: utf-8)
-s, --seed <seed> set the randomization seed
-d, --debug enable debug mode
Expand Down Expand Up @@ -132,9 +132,9 @@ options:
.\.venv\Scripts\activate
```

3. **Установите зависимости:**
3. **Установите проект с зависимостями для разработки:**
```bash
pip install -r requirements.txt
pip install -e ".[dev]"
```

4.1. **Установите пакет:**
Expand All @@ -153,9 +153,16 @@ options:
### Запуск тестов

```bash
pip install -e ".[test]"
pytest
```

Запуск тестов с подсчетом покрытия:

```bash
pytest --cov=xmlgenerator --cov-report=term-missing --cov-report=html
```

---

## Лицензия
Expand Down
2 changes: 1 addition & 1 deletion config_fns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ global:

value_override:
"^(ИдФайл|FileID)$": "{{ output_filename }}"
"^(ВерсПрог|VersProg)$": "xmlgenerator 0.9.0"
"^(ВерсПрог|VersProg)$": "xmlgenerator 0.9.1"
"Фамилия": "{{ last_name('ru_RU') }}"
"Имя": "{{ first_name('ru_RU') }}"
"Отчество": "{{ middle_name('ru_RU') }}"
Expand Down
Loading
Loading