Skip to content

Commit 8719d71

Browse files
authored
Merge pull request #4923 from psafont/pyver
2 parents 90eb1cb + 0809d25 commit 8719d71

File tree

6 files changed

+25
-71
lines changed

6 files changed

+25
-71
lines changed

.github/workflows/draft-release.yml

Lines changed: 14 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,27 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v3
1717

18-
- name: Pull configuration from xs-opam
19-
run: |
20-
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/master/tools/xs-opam-ci.env | cut -f2 -d " " > .env
21-
22-
- name: Load environment file
23-
id: dotenv
24-
uses: falti/[email protected]
25-
26-
- name: Use python
18+
- name: Use python
2719
uses: actions/setup-python@v4
2820
with:
2921
python-version: '3.x'
3022

31-
- name: Retrieve date for cache key
32-
id: cache-key
33-
run: echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
34-
shell: bash
35-
36-
- name: Restore opam cache
37-
id: opam-cache
38-
uses: actions/cache@v3
39-
with:
40-
path: "~/.opam"
41-
# invalidate cache daily, gets built daily using a scheduled job
42-
key: ${{ steps.cache-key.outputs.date }}
43-
44-
- name: Use ocaml
45-
uses: ocaml/setup-ocaml@v1
46-
with:
47-
ocaml-version: ${{ steps.dotenv.outputs.ocaml_version_full }}
48-
opam-repository: ${{ steps.dotenv.outputs.repository }}
49-
50-
- name: Install dependencies
23+
- name: Install build dependencies
5124
run: |
52-
opam update
53-
opam pin add xapi-datamodel . --no-action
54-
opam upgrade
55-
opam install xapi-stdext-unix xapi-datamodel
25+
pip install build
26+
sudo apt-get install ocaml dune libfindlib-ocaml-dev libdune-ocaml-dev libcmdliner-ocaml-dev
5627
5728
- name: Generate python package for XenAPI
5829
run: |
59-
opam exec -- ./configure
60-
opam exec -- make python
30+
./configure --xapi-version=${{ github.ref_name }}
31+
make python
6132
6233
- name: Draft Release ${{ github.ref_name }}
63-
id: create_release
64-
uses: softprops/action-gh-release@v1
65-
with:
66-
files: |
67-
scripts/examples/python/dist/*
68-
fail_on_unmatched_files: true
69-
draft: true
70-
generate_release_notes: true
34+
run: gh release create ${{ github.ref_name }} --draft --generate-notes
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Upload artifacts
39+
run: gh release upload ${{ github.ref_name }} scripts/examples/python/dist/*
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

quality-gate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ verify-cert () {
2525
}
2626

2727
mli-files () {
28-
N=510
28+
N=509
2929
# do not count ml files from the tests in ocaml/{tests/perftest/quicktest}
3030
MLIS=$(git ls-files -- '**/*.mli' | grep -vE "ocaml/tests|ocaml/perftest|ocaml/quicktest" | xargs -I {} sh -c "echo {} | cut -f 1 -d '.'" \;)
3131
MLS=$(git ls-files -- '**/*.ml' | grep -vE "ocaml/tests|ocaml/perftest|ocaml/quicktest" | xargs -I {} sh -c "echo {} | cut -f 1 -d '.'" \;)

scripts/examples/python/Makefile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
PROFILE=release
2+
SETUPTOOLS_SCM_PRETEND_VERSION ?= ""
23

34
.PHONY: build clean
45

5-
build: setup.py
6-
pip wheel -w dist --no-deps .
7-
python setup.py sdist
8-
9-
setup.py:
10-
dune build --profile=$(PROFILE) ./setuppy_gen.exe
11-
dune exec --profile=$(PROFILE) -- ./setuppy_gen.exe
6+
build:
7+
SETUPTOOLS_SCM_PRETEND_VERSION=$(XAPI_VERSION) python -m build --wheel .
8+
SETUPTOOLS_SCM_PRETEND_VERSION=$(XAPI_VERSION) python -m build --sdist .
129

1310
clean:
1411
dune clean
15-
rm -rf setup.py dist/ build/ XenAPI.egg-info/
12+
rm -rf dist/ build/ XenAPI.egg-info/

scripts/examples/python/dune

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[build-system]
2-
requires = ["setuptools >= 38.6.0", "wheel"]
3-
build-backend = "setuptools.build_meta:__legacy__"
2+
requires = ["setuptools >= 38.6.0", "setuptools_scm[toml]", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
root = "../../.."

scripts/examples/python/setuppy_gen.ml

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

0 commit comments

Comments
 (0)