Skip to content

feat: Make Python version configurable#592

Merged
dionhaefner merged 6 commits into
mainfrom
dion/config-py-version
Jun 15, 2026
Merged

feat: Make Python version configurable#592
dionhaefner merged 6 commits into
mainfrom
dion/config-py-version

Conversation

@dionhaefner

@dionhaefner dionhaefner commented May 17, 2026

Copy link
Copy Markdown
Contributor

Relevant issue or PR

n/a

Description of changes

This makes the Python version a Tesseract uses configurable. Since we already use UV for dependency installation, bootstrapping an arbitrary Python version into the image is trivial.

Default is python_version: null which still resolves to whatever the base image provides, so this is fully backwards compatible.

Testing done

CI, new e2e test

@codecov

codecov Bot commented May 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.23%. Comparing base (240e9f2) to head (23a4774).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #592      +/-   ##
==========================================
+ Coverage   76.91%   77.23%   +0.31%     
==========================================
  Files          32       32              
  Lines        4531     4537       +6     
  Branches      744      745       +1     
==========================================
+ Hits         3485     3504      +19     
+ Misses        740      728      -12     
+ Partials      306      305       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PasteurBot

PasteurBot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results

Benchmarks use a no-op Tesseract to measure pure framework overhead.

🚀 1 faster, ⚠️ 0 slower, ✅ 35 unchanged

Notable changes

Benchmark Baseline Current Change Status
decoding/base64_100,000 0.664ms 0.582ms -12.3% 🚀 faster
Full results
Benchmark Baseline Current Change Status
api/apply_1,000 0.595ms 0.586ms -1.5%
api/apply_100,000 0.595ms 0.586ms -1.5%
api/apply_10,000,000 0.591ms 0.587ms -0.7%
cli/apply_1,000 1689.560ms 1696.425ms +0.4%
cli/apply_100,000 1689.776ms 1722.232ms +1.9%
cli/apply_10,000,000 1730.042ms 1762.999ms +1.9%
decoding/base64_1,000 0.034ms 0.036ms +6.2%
decoding/base64_100,000 0.664ms 0.582ms -12.3% 🚀 faster
decoding/base64_10,000,000 67.237ms 66.268ms -1.4%
decoding/binref_1,000 0.204ms 0.204ms -0.2%
decoding/binref_100,000 0.249ms 0.244ms -1.8%
decoding/binref_10,000,000 10.514ms 9.506ms -9.6%
decoding/json_1,000 0.105ms 0.106ms +0.4%
decoding/json_100,000 8.779ms 8.737ms -0.5%
decoding/json_10,000,000 1063.969ms 1059.578ms -0.4%
encoding/base64_1,000 0.040ms 0.040ms -0.3%
encoding/base64_100,000 0.147ms 0.145ms -1.3%
encoding/base64_10,000,000 25.123ms 24.510ms -2.4%
encoding/binref_1,000 0.314ms 0.314ms +0.3%
encoding/binref_100,000 0.489ms 0.495ms +1.4%
encoding/binref_10,000,000 18.742ms 18.211ms -2.8%
encoding/json_1,000 0.149ms 0.150ms +0.2%
encoding/json_100,000 13.039ms 12.976ms -0.5%
encoding/json_10,000,000 1395.341ms 1395.335ms -0.0%
http/apply_1,000 3.235ms 3.237ms +0.1%
http/apply_100,000 9.063ms 9.039ms -0.3%
http/apply_10,000,000 763.207ms 763.044ms -0.0%
roundtrip/base64_1,000 0.087ms 0.085ms -2.8%
roundtrip/base64_100,000 0.738ms 0.736ms -0.4%
roundtrip/base64_10,000,000 92.872ms 92.112ms -0.8%
roundtrip/binref_1,000 0.532ms 0.539ms +1.4%
roundtrip/binref_100,000 0.753ms 0.747ms -0.8%
roundtrip/binref_10,000,000 29.706ms 28.665ms -3.5%
roundtrip/json_1,000 0.268ms 0.268ms -0.1%
roundtrip/json_100,000 19.588ms 19.587ms -0.0%
roundtrip/json_10,000,000 2469.794ms 2464.727ms -0.2%
  • Runner: Linux 6.17.0-1018-azure x86_64

@dionhaefner dionhaefner marked this pull request as ready for review June 15, 2026 11:18

@apaleyes apaleyes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried building/running a tesseract with default and specified python version. Tests seem fine. Timely change, thanks!

P.S. What do we do with py3.10 example now? Worth updating with new way to specifying python version? Or keep as an example of custom base image use?

@dionhaefner

Copy link
Copy Markdown
Contributor Author

py310 example is updated already ;)

@dionhaefner dionhaefner merged commit 0a925a7 into main Jun 15, 2026
52 checks passed
@dionhaefner dionhaefner deleted the dion/config-py-version branch June 15, 2026 19:22
@pasteurlabs pasteurlabs locked and limited conversation to collaborators Jun 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants