Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e362a65
Merge pull request #5 from JSv4/JSv4/bump-version-and-add-note-to-docs
JSv4 Apr 1, 2024
83a7e25
Build custom build action yaml and improve packaging script.
JSv4 Apr 1, 2024
00d3ae6
Remove unwanted binary in VCS
JSv4 Apr 1, 2024
2025e84
Changed build hook invocation to not rely on hatch.
JSv4 Apr 1, 2024
2314e5f
Add log lines.
JSv4 Apr 1, 2024
af22191
Verified build hook working via github pip dist. Unpackage script has…
JSv4 Apr 1, 2024
3c833e4
Updated unzip function to not overwrite existing binaries unless a fl…
JSv4 Apr 1, 2024
995fb8d
Add support for macOS in build and extraction process
rishabh-sagar-20 Apr 2, 2024
342c214
Fix numbering in developer guide documentation
rishabh-sagar-20 Apr 2, 2024
4ee2e99
Merge pull request #7 from SpotDraft/fix-binary-extraction-flow
JSv4 Apr 2, 2024
bd8545b
Added a workflow to build the latest differs.
JSv4 Apr 2, 2024
841a1bb
Update name of GitHub action workflow.
JSv4 Apr 2, 2024
803c8af
Updated dist .gitignore.
JSv4 Apr 2, 2024
29c746d
Tweaked .gitignore and commit the latest builds.
JSv4 Apr 2, 2024
b47ee1b
Fix typo.
JSv4 Apr 2, 2024
f9087c9
Revised build yaml
JSv4 Apr 2, 2024
ff165aa
Went back to build hook to try to get builds to be cleaner and keep b…
JSv4 Apr 2, 2024
54dd769
Drop the build workflow.
JSv4 Apr 2, 2024
0cd7a75
Merge pull request #6 from JSv4/JSv4/work-on-build-and-dist-infra
JSv4 Apr 2, 2024
13d7061
Bump version tag
JSv4 Apr 2, 2024
19a7d5a
Drop binaries.
JSv4 Apr 2, 2024
01eb785
Drop binaries.
JSv4 Apr 2, 2024
f7133bb
Merge branch 'main' of https://github.com/JSv4/Python-Docx-Redlines
JSv4 Apr 2, 2024
35a0fef
Updated publish workflow.
JSv4 Apr 2, 2024
91c945f
Tweak pyproject include.
JSv4 Apr 2, 2024
a834070
Drop dependency on hatch from build hook (again... lost this in the P…
JSv4 Apr 2, 2024
cc042da
add arm support
ross-mcnairn-dev May 29, 2024
10fa4f9
add windows arm64, patch READMEs
ross-mcnairn-dev May 30, 2024
3987569
parametrise target path
ross-mcnairn-dev May 31, 2024
3998921
Merge pull request #9 from ross-mcnairn-dev/main
JSv4 Jun 4, 2024
67b97a3
Merge pull request #2 from JSv4/main
ross-mcnairn-dev Jun 4, 2024
30d2a45
Merge branch 'main' into parametrise_target
ross-mcnairn-dev Jun 4, 2024
254e742
Merge pull request #10 from ross-mcnairn-dev/parametrise_target
JSv4 Jun 24, 2024
2003706
feat: Add FastAPI service for document redlining
google-labs-jules[bot] Oct 7, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generate a secure secret token, for example, by running:
# python -c 'import secrets; print(secrets.token_hex(32))'
API_TOKEN=your_secret_api_token_here
18 changes: 4 additions & 14 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
Expand All @@ -29,11 +21,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install hatch hatchling
- name: Build package
run: python -m build
run: hatch build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run: |
hatch publish -u "__token__" -a ${{ secrets.PYPI_API_TOKEN }}
253 changes: 25 additions & 228 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,236 +1,33 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C# Build Dirs
csproj/bin/*
csproj/obj/*
# Environment variables
.env

# C extensions
*.so
# Python cache
__pycache__/
*.pyc
*.pyo
*.pyd

# Distribution / packaging
.Python
build/
develop-eggs/
src/python_redlines/data/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
# Build artifacts
/dist/
/build/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
# Virtual environment
.venv/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/
env/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# IDE and editor files
.idea/
.vscode/
*.swp
*.swo

# Editor-based Rest Client
.idea/httpRequests
# Hatch
/.hatch/
/src/python_redlines/bin
/src/python_redlines/dist

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
# C# build artifacts
/csproj/bin/
/csproj/obj/
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Use an official Python runtime as a parent image
FROM python:3.11-slim

# Set the working directory in the container
WORKDIR /app

# Install .NET SDK and other dependencies
RUN apt-get update && \
apt-get install -y wget && \
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \
chmod +x ./dotnet-install.sh && \
./dotnet-install.sh --version 8.0.100 && \
rm dotnet-install.sh

# Add .dotnet to the PATH
ENV PATH="/root/.dotnet:$PATH"

# Copy files required for build
COPY pyproject.toml .
COPY hatch_run_build_hook.py .
COPY build_differ.py .
COPY src/python_redlines/__about__.py src/python_redlines/__about__.py
COPY csproj/ csproj/

# Install hatch
RUN pip install hatch

# Build the project (which includes running build_differ.py)
RUN hatch run default:build

# Copy the rest of the application code
COPY . .

# Expose the port the app runs on
EXPOSE 8000

# Start the API server
CMD ["hatch", "run", "api:start"]
Loading