Skip to content

Commit 57427bf

Browse files
authored
Fixes anaconda build issue (#78)
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
1 parent 7ba1e4d commit 57427bf

File tree

3 files changed

+39
-15
lines changed

3 files changed

+39
-15
lines changed

.github/workflows/release.yml

+24-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: release
22
on:
3+
pull_request:
34
push:
45
tags:
56
- 'v*'
@@ -46,8 +47,16 @@ jobs:
4647
~/.sbt
4748
~/.coursier
4849
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
49-
- run: |
50-
sbt createDistribution publish
50+
- name: sbt createDistribution
51+
run: |
52+
sbt createDistribution
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
SCALAPY_PYTHON_LIBRARY: "python3.12"
56+
- name: sbt publish
57+
run: |
58+
sbt publish
59+
if: startsWith(github.ref, 'refs/tags/')
5160
env:
5261
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5362
SCALAPY_PYTHON_LIBRARY: "python3.12"
@@ -63,13 +72,22 @@ jobs:
6372
if: startsWith(github.ref, 'refs/tags/')
6473
run: |
6574
poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD
66-
$CONDA/bin/conda update -n base -c defaults conda
67-
$CONDA/bin/conda install anaconda-client conda-build
68-
$CONDA/bin/conda build -c conda-forge --output-folder ./conda-out/ .
69-
anaconda upload --label main -u appthreat ./conda-out/noarch/*.tar.bz2
7075
env:
7176
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
7277
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
78+
- name: Build Anaconda
79+
run: |
80+
mkdir /tmp/conda-out
81+
$CONDA/bin/conda update -n base -c defaults conda
82+
$CONDA/bin/conda install anaconda-client conda-build conda-verify
83+
$CONDA/bin/conda build -c conda-forge --no-anaconda-upload --output-folder /tmp/conda-out/ .
84+
env:
85+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
86+
- name: Release Anaconda
87+
if: startsWith(github.ref, 'refs/tags/')
88+
run: |
89+
anaconda upload --label main -u appthreat /tmp/conda-out/noarch/*.tar.bz2
90+
env:
7391
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
7492
continue-on-error: true
7593
- run: sha512sum target/chen.zip > target/chen.zip.sha512

chenpy/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def install_py_modules(pack="database"):
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
185185
pip install pyg_lib -f https://data.pyg.org/whl/torch-2.3.0+cpu.html
186-
conda install -n chenpy-local -c conda-forge scipy numpy packageurl-python nbconvert jupyter_core jupyter_client notebook --solver=libmamba -y
186+
conda install -n chenpy-local -c conda-forge 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"):
189189
if line.strip():

meta.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ about:
1111
dev_url: https://github.com/appthreat/chen
1212
requirements:
1313
build:
14-
- python
1514
- pip
15+
- poetry
1616
host:
17-
- pip
1817
- python
19-
- setuptools
18+
- pip
2019
- poetry
2120
run:
22-
- python>=3.10,<3.12
21+
- python>=3.10,<3.13
2322
- conda-forge::httpx>=0.27.0
2423
- conda-forge::websockets>=12.0
2524
- conda-forge::orjson>=3.10.1,<4.0.0
@@ -30,26 +29,33 @@ requirements:
3029
- conda-forge::packageurl-python>=0.11.2,<0.12.0
3130
- conda-forge::gitpython>=3.1.43,<4.0.0
3231
- conda-forge::networkx>=3.3
33-
- conda-forge::numpy>=1.26
34-
- conda-forge::scipy>=1.11.3
3532
build:
33+
include_recipe: False
3634
pin_depends: record
3735
noarch: python
3836
script: |
3937
cp ${RECIPE_DIR}/pyproject.toml ${SRC_DIR}/
38+
cp ${RECIPE_DIR}/poetry.lock ${SRC_DIR}/
4039
cp ${RECIPE_DIR}/LICENSE ${SRC_DIR}/
4140
cp ${RECIPE_DIR}/README.md ${SRC_DIR}/
4241
cp ${RECIPE_DIR}/docker-compose.yml ${SRC_DIR}/
4342
cp -rf ${RECIPE_DIR}/docs ${SRC_DIR}/
4443
cp -rf ${RECIPE_DIR}/notebooks ${SRC_DIR}/
45-
rm -rf ${SRC_DIR}/{ci,console,dataflowengineoss,macros,platform,project,scripts,semanticcpg,target,tests,workspace}
44+
cp ${RECIPE_DIR}/codemeta.json ${SRC_DIR}/
45+
rm -rf ${SRC_DIR}/{ci,console,dataflowengineoss,macros,platform,project,scripts,semanticcpg,target,tests,workspace,chennai}
46+
{{ PYTHON }} -m poetry config virtualenvs.create false
47+
{{ PYTHON }} -m poetry install
4648
{{ PYTHON }} -m pip install --no-build-isolation --no-deps --ignore-installed .
4749
entry_points:
4850
- chen = chenpy.cli:main
4951

5052
source:
5153
path: ./chenpy
52-
folder: chenpy
54+
folder: ./chenpy
55+
56+
test:
57+
imports:
58+
- chenpy
5359

5460
extra:
5561
maintainers:

0 commit comments

Comments
 (0)