Skip to content

Commit 7ba1e4d

Browse files
authored
Python 3.12 support (#76)
* Python 3.12 support Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> --------- Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
1 parent ab80745 commit 7ba1e4d

14 files changed

+289
-295
lines changed

.github/workflows/containers.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Set up Python
3838
uses: actions/setup-python@v5
3939
with:
40-
python-version: '3.11'
40+
python-version: '3.12'
4141
- name: Use Node.js
4242
uses: actions/setup-node@v4
4343
with:
@@ -58,13 +58,13 @@ jobs:
5858
sbt stage createDistribution
5959
env:
6060
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
SCALAPY_PYTHON_LIBRARY: "python3.11"
61+
SCALAPY_PYTHON_LIBRARY: "python3.12"
6262
- name: Export python requirements
6363
run: |
64-
python3.11 -m pip install --upgrade pip
65-
python3.11 -m pip install poetry
66-
python3.11 -m poetry export -f requirements.txt --with=science --without-hashes --output target/chen-science-requirements.txt
67-
python3.11 -m poetry export -f requirements.txt --with=database --without-hashes --output target/chen-database-requirements.txt
64+
python3.12 -m pip install --upgrade pip
65+
python3.12 -m pip install poetry
66+
python3.12 -m poetry export -f requirements.txt --with=science --without-hashes --output target/chen-science-requirements.txt
67+
python3.12 -m poetry export -f requirements.txt --with=database --without-hashes --output target/chen-database-requirements.txt
6868
- name: Upload chen to ghcr
6969
run: |
7070
cd target

.github/workflows/master.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Python
2626
uses: actions/setup-python@v5
2727
with:
28-
python-version: '3.11'
28+
python-version: '3.12'
2929
- name: Use Node.js
3030
uses: actions/setup-node@v4
3131
with:
@@ -50,11 +50,11 @@ jobs:
5050
run: |
5151
bash ./platform/frontends/php2atom/install.sh
5252
npm install -g @appthreat/atom
53-
python3.11 -m pip install --upgrade pip
54-
python3.11 -m pip install poetry
55-
python3.11 -m poetry config virtualenvs.create false
56-
python3.11 -m poetry install --no-cache
57-
python3.11 -m poetry run flake8 chenpy --count --select=E9,F63,F7,F82 --show-source --statistics
53+
python3.12 -m pip install --upgrade pip
54+
python3.12 -m pip install poetry
55+
python3.12 -m poetry config virtualenvs.create false
56+
python3.12 -m poetry install --no-cache
57+
python3.12 -m poetry run flake8 chenpy --count --select=E9,F63,F7,F82 --show-source --statistics
5858
- uses: actions/cache@v4
5959
with:
6060
path: |
@@ -65,7 +65,7 @@ jobs:
6565
env:
6666
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF-8 -Djna.library.path=${{ env.Python3_ROOT_DIR }}"
68-
SCALAPY_PYTHON_LIBRARY: "python3.11"
68+
SCALAPY_PYTHON_LIBRARY: "python3.12"
6969
if: runner.os != 'Windows'
7070
- name: Compile and run tests
7171
run: sbt scalafmtCheck +test

.github/workflows/pr.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: pr
22
on: pull_request
33
jobs:
4-
test:
4+
pr-tests:
55
runs-on: ${{ matrix.os }}
66
strategy:
77
matrix:
@@ -26,7 +26,7 @@ jobs:
2626
- name: Set up Python
2727
uses: actions/setup-python@v5
2828
with:
29-
python-version: '3.11'
29+
python-version: '3.12'
3030
- name: Use Node.js
3131
uses: actions/setup-node@v4
3232
with:
@@ -69,7 +69,7 @@ jobs:
6969
env:
7070
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7171
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF-8 -Djna.library.path=${{ env.Python3_ROOT_DIR }}"
72-
SCALAPY_PYTHON_LIBRARY: "python3.11"
72+
SCALAPY_PYTHON_LIBRARY: "python3.12"
7373
if: runner.os != 'Windows'
7474
- name: Compile and run tests
7575
run: |
@@ -78,5 +78,5 @@ jobs:
7878
env:
7979
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8080
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF-8 -Djna.library.path=${{ env.Python3_ROOT_DIR }}"
81-
SCALAPY_PYTHON_LIBRARY: "python311"
81+
SCALAPY_PYTHON_LIBRARY: "python312"
8282
if: runner.os == 'Windows'

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Set up Python
3030
uses: actions/setup-python@v5
3131
with:
32-
python-version: '3.11'
32+
python-version: '3.12'
3333
- name: Use Node.js
3434
uses: actions/setup-node@v4
3535
with:
@@ -50,7 +50,7 @@ jobs:
5050
sbt createDistribution publish
5151
env:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53-
SCALAPY_PYTHON_LIBRARY: "python3.11"
53+
SCALAPY_PYTHON_LIBRARY: "python3.12"
5454
- name: Install and test
5555
run: |
5656
npm install -g @appthreat/atom

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Once the download finishes, the command will display the download location along
8181
[21:53:36] INFO To run chennai console, add the following environment variables to your .zshrc or .bashrc:
8282
export JAVA_OPTS="-Xmx16G"
8383
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8 -Djna.library.path=<lib dir>"
84-
export SCALAPY_PYTHON_LIBRARY=python3.11
84+
export SCALAPY_PYTHON_LIBRARY=python3.12
8585
export CHEN_HOME=/home/user/.local/share/chen
8686
export PATH=$PATH:/home/user/.local/share/chen/platform:/home/user/.local/share/chen/platform/bin:
8787
```
@@ -182,7 +182,7 @@ chennai> help
182182
183183
This error is mostly due to missing python .so (linux), .dll (windows) or .dylib (mac) file. Ensure the environment variables below are set correctly.
184184
185-
- SCALAPY_PYTHON_LIBRARY - Use values such as python3.10, python3.11 based on the version installed. On Windows, there are no dots. python311
185+
- SCALAPY_PYTHON_LIBRARY - Use values such as python3.10, python3.11 based on the version installed. On Windows, there are no dots. python312
186186
- JAVA_TOOL_OPTIONS - jna.library.path must be set to the python lib directory
187187
- SCALAPY_PYTHON_PROGRAMNAME - Path to Python executable in case of virtual environments (Usually not required)
188188

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "chen"
22
ThisBuild / organization := "io.appthreat"
3-
ThisBuild / version := "2.0.11"
3+
ThisBuild / version := "2.1.0"
44
ThisBuild / scalaVersion := "3.4.1"
55

66
val cpgVersion = "1.0.0"

chenpy/cli.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ def install_py_modules(pack="database"):
178178
"About to install the science pack using conda. A new environment called 'chenpy-local' will be created."
179179
)
180180
with Progress(transient=True) as progress:
181-
conda_install_script = """conda create --name chenpy-local python=3.11 -y
181+
conda_install_script = """conda create --name chenpy-local python=3.12 -y
182182
conda install -n chenpy-local conda-libmamba-solver -y
183183
conda install -n chenpy-local -c conda-forge networkx --solver=libmamba -y
184184
conda install -n chenpy-local -c pytorch pytorch torchtext cpuonly --solver=libmamba -y
185-
pip install pyg_lib -f https://data.pyg.org/whl/torch-2.1.0+cpu.html
185+
pip install pyg_lib -f https://data.pyg.org/whl/torch-2.3.0+cpu.html
186186
conda install -n chenpy-local -c conda-forge scipy numpy packageurl-python nbconvert jupyter_core jupyter_client notebook --solver=libmamba -y
187187
conda install -n chenpy-local -c conda-forge oras-py==0.1.26 httpx websockets orjson rich appdirs psutil gitpython --solver=libmamba -y"""
188188
for line in conda_install_script.split("\n"):

ci/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL maintainer="appthreat" \
44
org.opencontainers.image.authors="Team AppThreat <cloud@appthreat.com>" \
55
org.opencontainers.image.source="https://github.com/appthreat/chen" \
66
org.opencontainers.image.url="https://github.com/appthreat/chen" \
7-
org.opencontainers.image.version="2.0.x" \
7+
org.opencontainers.image.version="2.1.x" \
88
org.opencontainers.image.vendor="appthreat" \
99
org.opencontainers.image.licenses="Apache-2.0" \
1010
org.opencontainers.image.title="chen" \
@@ -27,7 +27,7 @@ ENV JAVA_VERSION=$JAVA_VERSION \
2727
PYTHONIOENCODING="utf-8" \
2828
JAVA_OPTS="-XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:+ParallelRefProcEnabled -XX:+UseStringDeduplication -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:+UnlockDiagnosticVMOptions -XX:G1SummarizeRSetStatsPeriod=1" \
2929
CHEN_DATAFLOW_TRACKED_WIDTH=128 \
30-
SCALAPY_PYTHON_LIBRARY=python3.11 \
30+
SCALAPY_PYTHON_LIBRARY=python3.12 \
3131
ANDROID_HOME=/opt/android-sdk-linux \
3232
CHEN_INSTALL_DIR=/opt/workspace \
3333
PHP_PARSER_BIN=/opt/vendor/bin/php-parse \

ci/conda-install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ pip install -U pip setuptools poetry
66
conda install -c conda-forge networkx -y
77
conda install -c conda-forge scipy numpy -y
88
conda install -c pytorch pytorch torchtext cpuonly -y
9-
pip install pyg_lib -f https://data.pyg.org/whl/torch-2.1.0+cpu.html
9+
pip install pyg_lib -f https://data.pyg.org/whl/torch-2.3.0+cpu.html
1010
conda install -c conda-forge packageurl-python nbconvert jupyter_core jupyter_client notebook -y
1111
conda install -c conda-forge oras-py httpx websockets orjson rich appdirs psutil gitpython -y

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"downloadUrl": "https://github.com/AppThreat/chen",
88
"issueTracker": "https://github.com/AppThreat/chen/issues",
99
"name": "chen",
10-
"version": "2.0.11",
10+
"version": "2.1.0",
1111
"description": "Code Hierarchy Exploration Net (chen) is an advanced exploration toolkit for your application source code and its dependency hierarchy.",
1212
"applicationCategory": "code-analysis",
1313
"keywords": [

docker-compose.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3.9"
21
services:
32
chennai:
43
image: ghcr.io/appthreat/chen
@@ -29,7 +28,7 @@ services:
2928
target: /opt/chenpy
3029
- action: sync
3130
path: ./chenpy
32-
target: /opt/miniconda3/lib/python3.11/site-packages/chenpy
31+
target: /opt/miniconda3/lib/python3.12/site-packages/chenpy
3332
volumes:
3433
- ./notebooks:/opt/notebooks
3534
- /tmp:/tmp

meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set version = "2.0.11" %}
1+
{% set version = "2.1.0" %}
22

33
package:
44
name: chen

0 commit comments

Comments
 (0)