Skip to content

Commit be337dd

Browse files
committed
Merge branch 'release/v1.0.1'
2 parents f4a49b4 + 5d62426 commit be337dd

Some content is hidden

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

45 files changed

+6494
-947
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ run-name: ${{ github.actor }} has launched CI process on ${{ github.ref_name }}
33
on:
44
push:
55
branches:
6-
- "main"
76
- "develop"
87
pull_request:
98
branches:
10-
- "main"
119
- "develop"
1210

1311
permissions:
@@ -32,64 +30,24 @@ jobs:
3230
java-version: 21
3331
distribution: 'temurin'
3432

35-
- name: Gradle build
36-
id: ci-gradle-build
37-
run: ./gradlew clean shadowJar
38-
39-
# - name: Gradle tests
40-
# run: ./gradlew test
41-
42-
# - name: Run Coverage
43-
# run: ./gradlew jacocoTestReport
44-
45-
# - name: Add coverage to PR
46-
# id: jacoco
47-
# uses: madrapps/jacoco-report@v1.7.0
48-
# with:
49-
# paths: |
50-
# **/build/reports/jacoco/test/jacocoTestReport.xml
51-
# token: ${{ secrets.GITHUB_TOKEN }}
52-
# min-coverage-overall: 40
53-
# min-coverage-changed-files: 60
54-
# update-comment: true
55-
56-
# - name: Get the Coverage info
57-
# run: |
58-
# echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
59-
# echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
60-
61-
# - name: Publish Test Results
62-
# uses: EnricoMi/publish-unit-test-result-action/linux@v2
63-
# if: always()
64-
# with:
65-
# files: |
66-
# build/test-results/**/*.xml
67-
68-
# - name: Get test artifacts
69-
# if: ${{ failure() }}
70-
# uses: actions/upload-artifact@v4
71-
# with:
72-
# name: Package
73-
# path: |
74-
# **/build/reports/
75-
# **/build/test-results/
76-
7733
- name: Set up Python 3.10
7834
uses: actions/setup-python@v3
7935
with:
8036
python-version: "3.10"
81-
- name: Install dependencies
37+
38+
- name: Install dependencies for ci process
8239
run: |
8340
python -m pip install --upgrade pip
8441
pip install pytest pytest-cov setuptools wheel build
85-
# next line may be replaced by a requirements.txt file
86-
pip install pandas py4j jpype1 maven-artifact
42+
8743
- name: Test with pytest
8844
run: |
8945
pytest -v
46+
9047
- name: Code coverage with pytest
9148
run: |
9249
pytest --cov
50+
9351
- name: Build libray
9452
run: |
9553
python -m build

.github/workflows/pypi.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: publish pycorese package on pypi.org
2+
run-name: ${{ github.actor }} has launched CI process on ${{ github.ref_name }}
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
8+
permissions:
9+
contents: read
10+
issues: read
11+
checks: write
12+
pull-requests: write
13+
14+
jobs:
15+
Continuous-Integration-Actions:
16+
runs-on: self-hosted
17+
18+
steps:
19+
- name: Checkout of head
20+
uses: actions/checkout@v4
21+
22+
- name: Set up JDK 21
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: 21
26+
distribution: 'temurin'
27+
28+
- name: Set up Python 3.10
29+
uses: actions/setup-python@v3
30+
with:
31+
python-version: "3.10"
32+
33+
- name: Install dependencies for ci process
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install pytest pytest-cov setuptools wheel build twine
37+
38+
- name: Test with pytest
39+
run: |
40+
pytest -v
41+
42+
- name: Code coverage with pytest
43+
run: |
44+
pytest --cov
45+
46+
- name: Copy Jars
47+
run: |
48+
mkdir -p ./resources
49+
rm -rf ./resources/*
50+
cp ./build/libs/*.jar ./resources/
51+
52+
- name: Build python libray
53+
run: |
54+
python -m build
55+
56+
- name: Publish to pypi.org
57+
run: |
58+
TWINE_USERNAME="__token__" TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }} twine upload dist/*
59+
60+
- name: Final Step
61+
run: |
62+
echo "This job's status is ${{ job.status }}."

.github/workflows/sphinx-dev.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Sphinx: Render development docs"
2+
run-name: ${{ github.actor }} has launched CI process on ${{ github.ref_name }}
3+
on:
4+
push:
5+
branches:
6+
- "develop"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
Continuous-Integration-Actions:
13+
runs-on: self-hosted
14+
15+
env:
16+
PACKAGE_TOKEN: ${{ secrets.JLS_TOKEN }}
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
ref: develop
23+
24+
- name: Fetch tags
25+
run: git fetch --prune --unshallow --tags --force
26+
27+
- name: Build Sphinx documentation with multiversion
28+
run: |
29+
source /builds/miniconda3/etc/profile.d/conda.sh
30+
conda activate corese-core-documentation
31+
sphinx-build docs/source/ build/html/dev/
32+
ghp-import build/html/dev/ -p -x dev

.github/workflows/sphinx-prod.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Sphinx: Render production docs"
2+
run-name: ${{ github.actor }} has launched CI process on ${{ github.ref_name }}
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
Continuous-Integration-Actions:
13+
runs-on: self-hosted
14+
15+
env:
16+
PACKAGE_TOKEN: ${{ secrets.JLS_TOKEN }}
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
ref: main
23+
24+
- name: Fetch tags
25+
run: git fetch --prune --unshallow --tags --force
26+
27+
- name: Build Sphinx documentation with multiversion
28+
run: |
29+
source /builds/miniconda3/etc/profile.d/conda.sh
30+
conda activate corese-core-documentation
31+
sphinx-multiversion docs/source build/html
32+
chmod u+x docs/switcher_generator.sh
33+
./docs/switcher_generator.sh build/html/switcher.json build/html/index.html
34+
35+
- name: Deploy to GitHub Pages
36+
uses: peaceiris/actions-gh-pages@v3
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: ./build/html
40+
keep_files: true

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ cython_debug/
164164
build
165165
log
166166

167+
# VSCode
168+
.vscode/
169+
170+
167171
# garbage
168172
\#*
169173
.\#*
174+
175+
# backup files
176+
resources/
177+
*.bak

CHANGES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
3+
## Version 1.0.1
4+
5+
- document local installaiton process (INSTALL.md)
6+
- build jar file then running `python -m build` (may need more work)
7+
- add doc skeleton and github action files
8+
- add coreseVersion (not fully implemented yet)
9+
10+
## Version 1.0.0
11+
12+
- first version, published only for debug test (do not use)

DESCRIPTION.md

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

INSTALL.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# how to build/test/install pycorese java gateway and python wrapper from sources
2+
3+
## build/install the python package
4+
5+
### prerequesite
6+
7+
```
8+
pip install --upgrade pip setuptools wheel build
9+
```
10+
11+
### clean all (not necessary if your just downloaded the sources)
12+
13+
```
14+
rm -fr dist build resources
15+
```
16+
17+
### build the package
18+
19+
```
20+
python -m build
21+
```
22+
23+
which build the packages into `./dist`
24+
25+
Remark:
26+
- do not run `python setup.py` which will not build the full package
27+
- the described install process will:
28+
29+
1/ compile the `corese-python-4.x.y-jar-with-dependencies.jar` file
30+
2/ download the `corese-core-4.x.y-jar-with-dependencies.jar` file from maven
31+
32+
- these two files are necessary to run the wrappers and are part of the distribution
33+
34+
### test
35+
36+
From the top directory, or in the `tests` sub-directory
37+
38+
```
39+
pip install pytest
40+
```
41+
42+
```
43+
pytest -v
44+
```
45+
46+
If a specific test fails, you can have more information, using:
47+
(you need to know the filename, test class name, test name)
48+
49+
eg:
50+
```
51+
pytest tests/test_api.py::Test_api::test_bad_bridge
52+
```
53+
54+
### code coverage
55+
56+
Install the coverage package:
57+
58+
```
59+
pip install pytest-cov
60+
```
61+
62+
And run the test coverage:
63+
64+
```
65+
pytest --cov
66+
```
67+
68+
If you prefer a browsable coverage report:
69+
70+
```
71+
pytest --cov --cov-report=html
72+
open htmlcov/index.html
73+
```
74+
75+
76+
### install the locally built package
77+
78+
```
79+
pip install dist/pycorese-1.0.1-py3-none-any.whl
80+
```
81+
82+
or
83+
```
84+
pip install dist/pycorese-1.0.1.tar.gz
85+
```
86+
87+
- verify your installation
88+
89+
```
90+
$ pip list | grep corese
91+
pycorese 1.0.1
92+
93+
$ python -c 'import pycorese'
94+
```
95+
96+
## Appendix 1: run local python example
97+
98+
### Conda environment
99+
100+
If necessary, we provide a conda environment:
101+
102+
```bash
103+
conda env update -f pkg/env/corese-python.yaml
104+
conda activate corese-python
105+
```
106+
107+
This makes available the python libraries: `pandas`, `py4j`, `jpype1`
108+
109+
### run a simple example using py4j bridge (without installing)
110+
111+
```
112+
./python_examples/simple_query.py -j $PWD/build/libs/corese-python-4.6.0-jar-with-dependencies.jar
113+
```
114+
115+
Remark: to build this jar file, you must follow the Appendix 2 instructions
116+
117+
### experimental: run a simple example using jpype bridge (without installing)
118+
119+
We focus the development on the py4j wrapping. The (still provided) jpype interface
120+
may still work (without garanty):
121+
122+
```
123+
./python_examples/simple_query.py -b jpype -j /somewhere/corese-core-4.6.0-jar-with-dependencies.jar
124+
```
125+
126+
127+
## Appendix 2: java compilation description
128+
129+
Remark: all these commands are launched then building/installing using the previous described process
130+
131+
### build jar file locally
132+
133+
```
134+
./gradlew shadowJar
135+
```
136+
137+
### download
138+
139+
```
140+
./gradlew downloadCoreseCore
141+
```

0 commit comments

Comments
 (0)