diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25088cc9..802e69db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,6 @@ name: release on: + pull_request: push: tags: - 'v*' @@ -46,8 +47,16 @@ jobs: ~/.sbt ~/.coursier key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }} - - run: | - sbt createDistribution publish + - name: sbt createDistribution + run: | + sbt createDistribution + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SCALAPY_PYTHON_LIBRARY: "python3.12" + - name: sbt publish + run: | + sbt publish + if: startsWith(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCALAPY_PYTHON_LIBRARY: "python3.12" @@ -63,13 +72,22 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: | poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD - $CONDA/bin/conda update -n base -c defaults conda - $CONDA/bin/conda install anaconda-client conda-build - $CONDA/bin/conda build -c conda-forge --output-folder ./conda-out/ . - anaconda upload --label main -u appthreat ./conda-out/noarch/*.tar.bz2 env: PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + - name: Build Anaconda + run: | + mkdir /tmp/conda-out + $CONDA/bin/conda update -n base -c defaults conda + $CONDA/bin/conda install anaconda-client conda-build conda-verify + $CONDA/bin/conda build -c conda-forge --no-anaconda-upload --output-folder /tmp/conda-out/ . + env: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + - name: Release Anaconda + if: startsWith(github.ref, 'refs/tags/') + run: | + anaconda upload --label main -u appthreat /tmp/conda-out/noarch/*.tar.bz2 + env: ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} continue-on-error: true - run: sha512sum target/chen.zip > target/chen.zip.sha512 diff --git a/chenpy/cli.py b/chenpy/cli.py index d8961463..a6218f8e 100644 --- a/chenpy/cli.py +++ b/chenpy/cli.py @@ -183,7 +183,7 @@ def install_py_modules(pack="database"): conda install -n chenpy-local -c conda-forge networkx --solver=libmamba -y conda install -n chenpy-local -c pytorch pytorch torchtext cpuonly --solver=libmamba -y pip install pyg_lib -f https://data.pyg.org/whl/torch-2.3.0+cpu.html -conda install -n chenpy-local -c conda-forge scipy numpy packageurl-python nbconvert jupyter_core jupyter_client notebook --solver=libmamba -y +conda install -n chenpy-local -c conda-forge numpy packageurl-python nbconvert jupyter_core jupyter_client notebook --solver=libmamba -y conda install -n chenpy-local -c conda-forge oras-py==0.1.26 httpx websockets orjson rich appdirs psutil gitpython --solver=libmamba -y""" for line in conda_install_script.split("\n"): if line.strip(): diff --git a/meta.yaml b/meta.yaml index 2b705b91..7444c66a 100644 --- a/meta.yaml +++ b/meta.yaml @@ -11,15 +11,14 @@ about: dev_url: https://github.com/appthreat/chen requirements: build: - - python - pip + - poetry host: - - pip - python - - setuptools + - pip - poetry run: - - python>=3.10,<3.12 + - python>=3.10,<3.13 - conda-forge::httpx>=0.27.0 - conda-forge::websockets>=12.0 - conda-forge::orjson>=3.10.1,<4.0.0 @@ -30,26 +29,33 @@ requirements: - conda-forge::packageurl-python>=0.11.2,<0.12.0 - conda-forge::gitpython>=3.1.43,<4.0.0 - conda-forge::networkx>=3.3 - - conda-forge::numpy>=1.26 - - conda-forge::scipy>=1.11.3 build: + include_recipe: False pin_depends: record noarch: python script: | cp ${RECIPE_DIR}/pyproject.toml ${SRC_DIR}/ + cp ${RECIPE_DIR}/poetry.lock ${SRC_DIR}/ cp ${RECIPE_DIR}/LICENSE ${SRC_DIR}/ cp ${RECIPE_DIR}/README.md ${SRC_DIR}/ cp ${RECIPE_DIR}/docker-compose.yml ${SRC_DIR}/ cp -rf ${RECIPE_DIR}/docs ${SRC_DIR}/ cp -rf ${RECIPE_DIR}/notebooks ${SRC_DIR}/ - rm -rf ${SRC_DIR}/{ci,console,dataflowengineoss,macros,platform,project,scripts,semanticcpg,target,tests,workspace} + cp ${RECIPE_DIR}/codemeta.json ${SRC_DIR}/ + rm -rf ${SRC_DIR}/{ci,console,dataflowengineoss,macros,platform,project,scripts,semanticcpg,target,tests,workspace,chennai} + {{ PYTHON }} -m poetry config virtualenvs.create false + {{ PYTHON }} -m poetry install {{ PYTHON }} -m pip install --no-build-isolation --no-deps --ignore-installed . entry_points: - chen = chenpy.cli:main source: path: ./chenpy - folder: chenpy + folder: ./chenpy + +test: + imports: + - chenpy extra: maintainers: