Skip to content

Commit fbe8204

Browse files
chore: move Python Solver to new repo (#1693)
Moving the code to https://github.com/TimefoldAI/timefold-solver-python/ --------- Co-authored-by: Lukáš Petrovický <[email protected]>
1 parent 7bce5c2 commit fbe8204

File tree

555 files changed

+122
-93654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

555 files changed

+122
-93654
lines changed

.github/workflows/codeql.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ jobs:
2727
include:
2828
- language: java-kotlin
2929
build-mode: autobuild
30-
- language: python
31-
build-mode: none
3230
- language: javascript-typescript # Need to add this even though we don't want this; otherwise Github complains.
3331
build-mode: none
3432
steps:

.github/workflows/finish_release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
git config user.email "[email protected]"
2424
git checkout $RELEASE_BRANCH_NAME
2525
mvn -Dfull versions:set -DnewVersion=999-SNAPSHOT
26-
sed -i "s/^timefold_solver_python_version.*=.*/timefold_solver_python_version = '999-dev0'/" setup.py
2726
git commit -am "build: move back to 999-SNAPSHOT"
2827
git push origin $RELEASE_BRANCH_NAME
2928

.github/workflows/pull_request.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -103,54 +103,6 @@ jobs:
103103
cd spring-integration
104104
mvn -B verify
105105
106-
python:
107-
name: "Python Solver"
108-
concurrency:
109-
group: pull_request-python-${{ github.event_name }}-${{ github.head_ref }}-${{ matrix.os }}-${{ matrix.java-version }}
110-
cancel-in-progress: true
111-
runs-on: ${{matrix.os}}
112-
strategy:
113-
matrix:
114-
os: [ ubuntu-latest, macos-latest, windows-latest ]
115-
java-version: [ 21 ] # Latest LTS if not Ubuntu
116-
include:
117-
- os: ubuntu-latest
118-
java-version: 17
119-
- os: ubuntu-latest
120-
java-version: 24
121-
timeout-minutes: 120
122-
steps:
123-
- uses: actions/checkout@v4
124-
125-
- uses: actions/setup-java@v4
126-
with:
127-
java-version: ${{matrix.java-version}}
128-
distribution: 'temurin'
129-
cache: 'maven'
130-
131-
# Need to install all Python versions in the same run for tox
132-
- name: Python 3.10, Python 3.11, Python 3.12 Setup
133-
uses: actions/setup-python@v5
134-
with:
135-
python-version: |
136-
3.10
137-
3.11
138-
3.12
139-
cache: 'pip'
140-
cache-dependency-path: |
141-
**/setup.py
142-
143-
- name: Install tox
144-
run:
145-
pip install tox build
146-
147-
- name: Run tox on Timefold Solver for Python test suite
148-
run: python -m tox
149-
150-
- name: Run tox on jpyinterpreter test suite
151-
working-directory: ./python/jpyinterpreter
152-
run: python -m tox
153-
154106
native:
155107
name: "Native Image"
156108
concurrency:

.github/workflows/pull_request_quickstarts.yml

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -67,69 +67,4 @@ jobs:
6767
- name: Build and test timefold-quickstarts
6868
working-directory: ./timefold-quickstarts
6969
shell: bash
70-
run: mvn -B clean verify
71-
python:
72-
name: "Python Quickstarts"
73-
concurrency:
74-
group: pull_request_python_quickstarts-${{ github.event_name }}-${{ github.head_ref }}-${{ matrix.os }}-${{ matrix.java-version }}-${{ matrix.python-version }}
75-
cancel-in-progress: true
76-
strategy:
77-
matrix:
78-
os: [ ubuntu-latest ]
79-
java-version: [ 21 ] # Only the latest supported LTS; already too many jobs here.
80-
# TODO: Add Python 3.10 once employee scheduling and school timetabling support it
81-
python-version: ['3.11', '3.12']
82-
fail-fast: false
83-
runs-on: ${{ matrix.os }}
84-
85-
steps:
86-
- name: Check out repository code
87-
uses: actions/checkout@v4
88-
with:
89-
path: './timefold-solver'
90-
91-
# Need to check for stale repo, since Github is not aware of the build chain and therefore doesn't automate it.
92-
- name: Checkout timefold-quickstarts (PR) # Checkout the PR branch first, if it exists
93-
if: github.head_ref # Only true if this is a PR.
94-
id: checkout-quickstarts-pr
95-
uses: actions/checkout@v4
96-
continue-on-error: true
97-
with:
98-
repository: ${{ github.actor }}/timefold-quickstarts
99-
ref: ${{ github.head_ref }}
100-
path: ./timefold-quickstarts
101-
fetch-depth: 0 # Otherwise merge will fail on account of not having history.
102-
- name: Checkout timefold-quickstarts (development) # Checkout the development branch if the PR branch does not exist
103-
if: steps.checkout-quickstarts-pr.outcome != 'success'
104-
uses: actions/checkout@v4
105-
with:
106-
repository: TimefoldAI/timefold-quickstarts
107-
ref: development
108-
path: ./timefold-quickstarts
109-
fetch-depth: 0 # Otherwise merge will fail on account of not having history.
110-
111-
# Build and test
112-
- name: "Setup Java and Maven"
113-
uses: actions/setup-java@v4
114-
with:
115-
java-version: ${{matrix.java-version}}
116-
distribution: 'temurin'
117-
cache: 'maven'
118-
- name: Python Setup
119-
uses: actions/setup-python@v5
120-
with:
121-
python-version: ${{matrix.python-version}}
122-
cache: 'pip'
123-
cache-dependency-path: |
124-
**/setup.py
125-
- name: Install build
126-
run:
127-
pip install build
128-
- name: Build Timefold Solver for Python
129-
working-directory: ./timefold-solver
130-
run: python -m build
131-
- name: Build and test timefold-quickstarts
132-
working-directory: ./timefold-quickstarts
133-
env:
134-
TIMEFOLD_SOLVER_PYTHON_DIST: "${{ github.workspace }}/timefold-solver/dist"
135-
run: .github/scripts/run_python_tests.sh
70+
run: mvn -B clean verify

.github/workflows/pull_request_secure.yml

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -187,77 +187,6 @@ jobs:
187187
working-directory: ./timefold-solver-enterprise
188188
shell: bash
189189
run: mvn -B clean verify
190-
enterprise-python:
191-
needs: approval_required
192-
name: Enterprise Edition (Python)
193-
concurrency:
194-
group: downstream-enterprise-python-${{ github.event_name }}-${{ github.head_ref }}
195-
cancel-in-progress: true
196-
timeout-minutes: 120
197-
runs-on: ubuntu-latest
198-
steps:
199-
- name: Check out repository code
200-
uses: actions/checkout@v4
201-
with:
202-
path: './timefold-solver'
203-
ref: ${{ github.event.pull_request.head.sha }} # The GHA event will pull the main branch by default, and we must specify the PR reference version
204-
205-
# Clone timefold-solver-enterprise
206-
# Need to check for stale repo, since Github is not aware of the build chain and therefore doesn't automate it.
207-
- name: Checkout timefold-solver-enterprise (PR) # Checkout the PR branch first, if it exists
208-
id: checkout-solver-enterprise
209-
uses: actions/checkout@v4
210-
continue-on-error: true
211-
with:
212-
repository: TimefoldAI/timefold-solver-enterprise
213-
ref: ${{ github.head_ref }}
214-
token: ${{ secrets.JRELEASER_GITHUB_TOKEN }} # Safe; only used to clone the repo and not stored in the fork.
215-
path: ./timefold-solver-enterprise
216-
fetch-depth: 0 # Otherwise merge will fail on account of not having history.
217-
218-
- name: Checkout timefold-solver-enterprise (main) # Checkout the main branch if the PR branch does not exist
219-
if: steps.checkout-solver-enterprise.outcome != 'success'
220-
uses: actions/checkout@v4
221-
with:
222-
repository: TimefoldAI/timefold-solver-enterprise
223-
ref: main
224-
token: ${{ secrets.JRELEASER_GITHUB_TOKEN }} # Safe; only used to clone the repo and not stored in the fork.
225-
path: ./timefold-solver-enterprise
226-
fetch-depth: 0 # Otherwise merge will fail on account of not having history.
227-
228-
# Build and test
229-
- name: Set up the JDK
230-
uses: actions/setup-java@v4
231-
with:
232-
java-version: 17
233-
distribution: 'temurin'
234-
cache: 'maven'
235-
236-
# Need to install all Python versions in the same run for tox
237-
- name: Python 3.10, Python 3.11, Python 3.12 Setup
238-
uses: actions/setup-python@v5
239-
with:
240-
python-version: |
241-
3.10
242-
3.11
243-
3.12
244-
cache: 'pip'
245-
cache-dependency-path: |
246-
**/setup.py
247-
248-
- name: Install tox
249-
run:
250-
pip install tox build
251-
252-
- name: Build Timefold Solver for Python
253-
working-directory: ./timefold-solver
254-
run: python -m build
255-
256-
- name: Run tox on Timefold Solver Enterprise for Python test suite
257-
working-directory: ./timefold-solver-enterprise
258-
env:
259-
PIP_FIND_LINKS: ${{ github.workspace }}/timefold-solver/dist
260-
run: tox
261190

262191
build_documentation:
263192
runs-on: ubuntu-latest
@@ -350,19 +279,6 @@ jobs:
350279
java-version: 17
351280
distribution: 'temurin'
352281
cache: 'maven'
353-
- name: Python 3.10, Python 3.11, Python 3.12 Setup
354-
uses: actions/setup-python@v5
355-
with:
356-
python-version: |
357-
3.10
358-
3.11
359-
3.12
360-
cache: 'pip'
361-
cache-dependency-path: |
362-
**/setup.py
363-
- name: Install tox
364-
run:
365-
pip install tox coverage pytest pytest-cov
366282
- name: Cache SonarCloud packages
367283
uses: actions/cache@v4
368284
with:
@@ -372,24 +288,6 @@ jobs:
372288
- name: Build with Maven to measure code coverage # The ENV variables are limited to the scope of the current step. Avoid adding sensitive ENV variables here as the tests could leak them.
373289
run: mvn -B clean install -Prun-code-coverage
374290

375-
- name: Get JaCoCo Agent
376-
run: mvn org.apache.maven.plugins:maven-dependency-plugin:3.8.1:copy -Dartifact=org.jacoco:org.jacoco.agent:0.8.13:jar:runtime -DoutputDirectory=target/jacocoagent.jar
377-
378-
- name: Run tox to measure timefold solver python code coverage from Python tests
379-
# Sometimes crashes at the very end when using JaCoCo.
380-
# This crash happens after everything is processed and stored, and therefore can be safely ignored.
381-
# Ignore the crash to not ruin the long-running build.
382-
continue-on-error: true
383-
run: python -m tox -- --cov=timefold --cov-report=xml:target/coverage.xml --cov-config=tox.ini --cov-branch --cov-append --jacoco-agent=./target/jacocoagent.jar
384-
385-
- name: Run tox to measure jpyinterpreter code coverage from Python tests
386-
working-directory: ./python/jpyinterpreter
387-
# Sometimes crashes at the very end when using JaCoCo.
388-
# This crash happens after everything is processed and stored, and therefore can be safely ignored.
389-
# Ignore the crash to not ruin the long-running build.
390-
continue-on-error: true
391-
run: python -m tox -- --cov=jpyinterpreter --cov-report=xml:target/coverage.xml --cov-config=tox.ini --cov-branch --cov-append --jacoco-agent=../../target/jacocoagent.jar --jacoco-output=../../target/jacoco.exec
392-
393291
- name: Run analysis
394292
env:
395293
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any

.github/workflows/release.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ on:
1616
version:
1717
description: 'Release version (e.g. 1.0.0)'
1818
required: true
19-
pythonVersionSuffix:
20-
description: 'What suffix to append to the Python version (ex: b0 for beta release)'
21-
required: true
22-
default: b0
2319
sourceBranch:
2420
description: 'Branch to cut the release from'
2521
default: main
@@ -34,9 +30,6 @@ jobs:
3430
MAVEN_ARGS: "--no-transfer-progress --batch-mode"
3531
RELEASE_BRANCH_NAME: "__timefold_release_branch__"
3632
runs-on: self-hosted
37-
environment:
38-
name: pypi
39-
url: https://pypi.org/p/timefold
4033
permissions:
4134
contents: write # IMPORTANT: required for action to create release branch
4235
pull-requests: write # IMPORTANT: so release PR can be created
@@ -70,25 +63,13 @@ jobs:
7063
with:
7164
maven-version: 3.9.3
7265

73-
- name: Python 3.12 Setup
74-
uses: actions/setup-python@v5
75-
with:
76-
python-version: 3.12
77-
78-
- name: Install Pip and build
79-
run: |
80-
python -m pip install --upgrade pip
81-
pip install build
82-
8366
# We skip tests in dry run, to make the process faster.
8467
# Technically, this goes against the main reason for doing a dry run; to eliminate potential problems.
8568
# But unless something catastrophic happened, PR checks on source branch already ensured that all tests pass.
8669
- name: Set release version and build release
8770
run: |
8871
mvn -Dfull versions:set -DnewVersion=${{ github.event.inputs.version }}
89-
sed -i "s/^timefold_solver_python_version.*=.*/timefold_solver_python_version = '${{ github.event.inputs.version }}${{ github.event.inputs.pythonVersionSuffix }}'/" setup.py
9072
mvn -Dfull deploy -DskipTests=${{ github.event.inputs.dryRun }} -DaltDeploymentRepository=local::default::file://`pwd`/target/staging-deploy
91-
python -m build
9273
cp docs/target/antora-template.yml docs/src/antora.yml
9374
git add docs/src/antora.yml
9475
find . -name 'pom.xml' | xargs git add
@@ -115,7 +96,3 @@ jobs:
11596
path: |
11697
out/jreleaser/trace.log
11798
out/jreleaser/output.properties
118-
119-
- name: Publish distribution to PyPI
120-
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1
121-
if: ${{ github.event.inputs.dryRun == 'false' }}

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
target
22
local
3-
__pycache__
4-
/*.egg-info
5-
/dist
6-
/python/**/dist
7-
/python/**/*.egg-info
8-
/python/**/*-stubs
93

104
# Eclipse, Netbeans and IntelliJ files
115
/.*

CONTRIBUTING.adoc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ Use one of the following ways to build this project:
2828

2929
* :mechanical_arm: *build-all*: `mvn clean install -Dfull` runs all checks and creates documentation and distribution files (~20 min)
3030

31-
=== Build the Timefold Solver Python package
32-
33-
* :hammer: *build-fast*: `python -m build` skips any checks and code analysis (~1 min)
34-
35-
* :mechanical_arm: *build-test*: `tox -e pyVERSION` (for example, `tox -e py310`) runs tests against a given Python versions (~3 min)
36-
37-
* :mechanical_arm: *build-all*: `tox` runs tests against all supported Python versions (~10 min)
38-
3931

4032
=== Set up your development environment
4133

MANIFEST.in

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ image:https://img.shields.io/github/issues/TimefoldAI/timefold-solver?style=for-
1717
{sonarBadge}&metric=sqale_rating["Maintainability Rating", {sonarLink}]
1818
{sonarBadge}&metric=coverage["Coverage", {sonarLink}]
1919

20-
Timefold Solver is an AI constraint solver for Java,
21-
https://github.com/TimefoldAI/timefold-solver/tree/main/python#readme[Python] and Kotlin.
20+
Timefold Solver is an AI constraint solver for Java and Kotlin.
2221
You can use Timefold Solver to optimize the Vehicle Routing Problem, Employee Rostering,
2322
Maintenance Scheduling, Task Assignment, School Timetabling, Cloud Optimization,
2423
Conference Scheduling, Job Shop Scheduling and many more planning problems.

0 commit comments

Comments
 (0)