Skip to content

Commit

Permalink
Merge pull request #4923 from psafont/pyver
Browse files Browse the repository at this point in the history
  • Loading branch information
psafont authored Feb 28, 2023
2 parents 90eb1cb + 0809d25 commit 8719d71
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 71 deletions.
57 changes: 14 additions & 43 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,27 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Pull configuration from xs-opam
run: |
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/master/tools/xs-opam-ci.env | cut -f2 -d " " > .env
- name: Load environment file
id: dotenv
uses: falti/[email protected]

- name: Use python
- name: Use python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Retrieve date for cache key
id: cache-key
run: echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash

- name: Restore opam cache
id: opam-cache
uses: actions/cache@v3
with:
path: "~/.opam"
# invalidate cache daily, gets built daily using a scheduled job
key: ${{ steps.cache-key.outputs.date }}

- name: Use ocaml
uses: ocaml/setup-ocaml@v1
with:
ocaml-version: ${{ steps.dotenv.outputs.ocaml_version_full }}
opam-repository: ${{ steps.dotenv.outputs.repository }}

- name: Install dependencies
- name: Install build dependencies
run: |
opam update
opam pin add xapi-datamodel . --no-action
opam upgrade
opam install xapi-stdext-unix xapi-datamodel
pip install build
sudo apt-get install ocaml dune libfindlib-ocaml-dev libdune-ocaml-dev libcmdliner-ocaml-dev
- name: Generate python package for XenAPI
run: |
opam exec -- ./configure
opam exec -- make python
./configure --xapi-version=${{ github.ref_name }}
make python
- name: Draft Release ${{ github.ref_name }}
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
scripts/examples/python/dist/*
fail_on_unmatched_files: true
draft: true
generate_release_notes: true
run: gh release create ${{ github.ref_name }} --draft --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload artifacts
run: gh release upload ${{ github.ref_name }} scripts/examples/python/dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion quality-gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ verify-cert () {
}

mli-files () {
N=510
N=509
# do not count ml files from the tests in ocaml/{tests/perftest/quicktest}
MLIS=$(git ls-files -- '**/*.mli' | grep -vE "ocaml/tests|ocaml/perftest|ocaml/quicktest" | xargs -I {} sh -c "echo {} | cut -f 1 -d '.'" \;)
MLS=$(git ls-files -- '**/*.ml' | grep -vE "ocaml/tests|ocaml/perftest|ocaml/quicktest" | xargs -I {} sh -c "echo {} | cut -f 1 -d '.'" \;)
Expand Down
13 changes: 5 additions & 8 deletions scripts/examples/python/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
PROFILE=release
SETUPTOOLS_SCM_PRETEND_VERSION ?= ""

.PHONY: build clean

build: setup.py
pip wheel -w dist --no-deps .
python setup.py sdist

setup.py:
dune build --profile=$(PROFILE) ./setuppy_gen.exe
dune exec --profile=$(PROFILE) -- ./setuppy_gen.exe
build:
SETUPTOOLS_SCM_PRETEND_VERSION=$(XAPI_VERSION) python -m build --wheel .
SETUPTOOLS_SCM_PRETEND_VERSION=$(XAPI_VERSION) python -m build --sdist .

clean:
dune clean
rm -rf setup.py dist/ build/ XenAPI.egg-info/
rm -rf dist/ build/ XenAPI.egg-info/
10 changes: 0 additions & 10 deletions scripts/examples/python/dune

This file was deleted.

7 changes: 5 additions & 2 deletions scripts/examples/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[build-system]
requires = ["setuptools >= 38.6.0", "wheel"]
build-backend = "setuptools.build_meta:__legacy__"
requires = ["setuptools >= 38.6.0", "setuptools_scm[toml]", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
root = "../../.."
7 changes: 0 additions & 7 deletions scripts/examples/python/setuppy_gen.ml

This file was deleted.

0 comments on commit 8719d71

Please sign in to comment.