Skip to content

Commit 984c000

Browse files
[new package] ocaml-in-python.0.1.0 (ocaml#20991)
* [new package] ocaml-in-python.0.1.0 This pull request publishes the first release of `ocaml-in-python`, a Python package for automatic bindings of OCaml modules. * Fix lint warning: unnecessary field 'version' * Fix compatibility errors with Python <3.10 * Update dependencies * Use python3 instead of python * Fix pyml bug * Remove constraint on OCaml version for metaquot * Dependency to Python 3.7 * Compatibility with flambda * Fix pyml checksum * Use SPDX identifier for Python license * Add missing substs * Restore python3 for Python command * conf-python-3-7 should fail if Python is not found
1 parent 6ccea0f commit 984c000

File tree

6 files changed

+144
-1
lines changed

6 files changed

+144
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
for version in 3.10 3.9 3.8 3.7; do
2+
python_exe="python$version"
3+
if "$python_exe" test.py; then
4+
echo "python3: \"$python_exe\"" >> conf-python-3-7.config
5+
exit 0
6+
fi
7+
done
8+
exit 1
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import sys
2+
assert(sys.hexversion >= 0x03070000)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
opam-version: "2.0"
2+
maintainer: "[email protected]"
3+
homepage: "https://www.python.org/download/releases/3.7"
4+
authors: "Python Software Foundation"
5+
license: "PSF-2.0"
6+
bug-reports: "https://github.com/ocaml/opam-repository/issues"
7+
build: ["bash" "-ex" "configure.sh"]
8+
depexts: [
9+
["python3.7"]
10+
{os-distribution = "ubuntu" & os-version < "20.04"}
11+
["python3"] {os-family = "debian"
12+
& !(os-distribution = "ubuntu" & os-version < "20.04")}
13+
["python3"] {os-distribution = "nixos"}
14+
["python3"] {os-distribution = "alpine"}
15+
["python37" "epel-release"] {os-distribution = "centos"}
16+
["python3"] {os-distribution = "fedora"}
17+
["python38"] {os-distribution = "ol"} # No python37 package
18+
["python"] {os-distribution = "arch"}
19+
["python3"] {os-family = "suse"}
20+
["dev-lang/python:3.7"] {os-distribution = "gentoo"}
21+
["python3"] {os = "openbsd"}
22+
["lang/python37"] {os = "netbsd"}
23+
["lang/python37"] {os = "freebsd"}
24+
["python37"] {os-distribution = "macports" & os = "macos"}
25+
["python@3"] {os-distribution = "homebrew" & os = "macos"}
26+
["system:python3"] {os-distribution = "cygwinports"}
27+
]
28+
x-ci-accept-failures: [
29+
"opensuse-15.3" # python >=3.7 not packaged
30+
]
31+
synopsis: "Virtual package relying on Python >=3.7 installation"
32+
description: """
33+
This package can only install if a Python interpreter >=3.7 is available
34+
on the system.
35+
If a minor version needs to be specified for your operating system, then
36+
python-3.7 will be used.
37+
"""
38+
extra-files: [
39+
["test.py" "sha512=a9d993b9380d636fc2aff8af6bae1078ad14a2af4e510b7c437d5f1e01cd125b7f12e15fb8f0e0c4536d2f7d6aa0d36aafdf2f9da828ac7686df6dc782fa1a23"]
40+
["configure.sh" "sha512=d2dc0f2a0867aa04ffbaf28fd8fdac745036454cc4dbeb56d59344dfab80c09e8c30ff57a311667880164164e44aa9efd917cfdeed330fb5f224ee201a841206"]]
41+
flags: conf

packages/metaquot/metaquot.0.5.1/opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage: "https://github.com/thierry-martinez/metaquot"
1010
doc: "https://github.com/thierry-martinez/metaquot"
1111
bug-reports: "https://github.com/thierry-martinez/metaquot"
1212
depends: [
13-
"ocaml" {>= "4.08.0" & < "4.14"}
13+
"ocaml" {>= "4.08.0"}
1414
"stdcompat" {>= "12"}
1515
"ppxlib" {>= "0.22.0"}
1616
"ocamlfind" {>= "1.8.1"}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
opam-version: "2.0"
2+
synopsis: "Effortless Python bindings for OCaml modules"
3+
description: """
4+
Effortless Python bindings for OCaml modules
5+
"""
6+
maintainer: ["Thierry Martinez <[email protected]>"]
7+
authors: ["Thierry Martinez <[email protected]>"]
8+
license: "BSD-2-Clause"
9+
homepage: "https://github.com/thierry-martinez/ocaml-in-python"
10+
doc: "https://github.com/thierry-martinez/ocaml-in-python"
11+
bug-reports: "https://github.com/thierry-martinez/ocaml-in-python"
12+
depends: [
13+
"dune" {>= "2.9"}
14+
"ocaml" {>= "4.13.0"}
15+
"ppxlib" {>= "0.23.0"}
16+
"metapp" {>= "0.4.3"}
17+
"metaquot" {>= "0.5.1"}
18+
"pyml" {>= "20220325"}
19+
"conf-python-3-7"
20+
"parmap" {with-test}
21+
"odoc" {with-doc}
22+
]
23+
build: [
24+
["dune" "subst"] {dev}
25+
[
26+
"dune"
27+
"build"
28+
"-p"
29+
name
30+
"-j"
31+
jobs
32+
"--promote-install-files=false"
33+
"@install"
34+
"@runtest" {with-test}
35+
"@doc" {with-doc}
36+
]
37+
["dune" "install" "-p" name "--create-install-files" name]
38+
]
39+
dev-repo: "git+https://github.com/thierry-martinez/ocaml-in-python"
40+
substs: ["python3-command"]
41+
post-messages: "\
42+
You should register the \"ocaml\" package in your Python environment.
43+
There are two options:
44+
45+
(1) either you register the package with \"pip\" using the following
46+
command:
47+
pip install --editable \"%{lib}%/ocaml-in-python\"
48+
49+
(2) or you add the following definition to your environment:
50+
export PYTHONPATH=\"%{share}%/python/:$PYTHONPATH\"
51+
" {success}
52+
url {
53+
src: "https://github.com/thierry-martinez/ocaml-in-python/releases/download/v0.1.0/ocaml-in-python-0.1.0.tar.gz"
54+
checksum: "sha512=9ba2ad109ce83a758dd949fc40be8e866adb5aebf3b2009a04c4d93ea40f48ca71b8d6f8cd4e80a2bf52ca36fab6561f28e273d412cf8c235837063924f26eff"
55+
}

packages/pyml/pyml.20220325/opam

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
opam-version: "2.0"
2+
maintainer: "Thierry Martinez <[email protected]>"
3+
authors: "Thierry Martinez <[email protected]>"
4+
homepage: "http://github.com/thierry-martinez/pyml"
5+
bug-reports: "http://github.com/thierry-martinez/pyml/issues"
6+
license: "BSD-2-Clause"
7+
dev-repo: "git+https://github.com/thierry-martinez/pyml.git"
8+
build: [
9+
["dune" "subst"] {dev}
10+
[
11+
"dune"
12+
"build"
13+
"-p"
14+
name
15+
"-j"
16+
jobs
17+
"@install"
18+
"@runtest" {with-test}
19+
"@doc" {with-doc}
20+
]
21+
]
22+
run-test: [make "test"]
23+
synopsis: "OCaml bindings for Python"
24+
description: "OCaml bindings for Python 2 and Python 3"
25+
depends: [
26+
"ocaml" {>= "3.12.1"}
27+
"dune" {>= "2.8.0"}
28+
"ocamlfind" {build}
29+
"stdcompat" {>= "18"}
30+
"conf-python-3-dev" {with-test}
31+
"odoc" {with-doc}
32+
]
33+
depopts: ["utop"]
34+
url {
35+
src: "https://github.com/thierry-martinez/pyml/releases/download/20220325/pyml-20220325.tar.gz"
36+
checksum: "sha512=462f86478a0131248805cc13d7eb4e5b4259241d9074e5ab00221018b7fe2d023a12ebf7ffcb81211ffca689fb6b065f251bd900e1925c481f98169e652ab6fa"
37+
}

0 commit comments

Comments
 (0)