rust-cpython: allow compilation for both py2 and py3

Summary:
Set up the `cpython-ext` and `hgcommands` libraries so that they can compile
against py2 and py3 versions of rust-cpython.  Make py2 the default so
that cargo test still works.

Reviewed By: singhsrb

Differential Revision: D19615656

fbshipit-source-id: 3403e7077deb3c0a9dfe0e3b7d4f4ad1da73bba3
This commit is contained in:
Mark Thomas 2020-01-28 20:15:35 -08:00 committed by Facebook Github Bot
parent 9f2330a832
commit 1e63f205f4
26 changed files with 28 additions and 28 deletions

View File

@ -5,5 +5,5 @@ edition = "2018"
[dependencies]
blackbox = { path = "../../../../lib/blackbox" }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }

View File

@ -6,5 +6,5 @@ edition = "2018"
[dependencies]
bookmarkstore = { path = "../../../../lib/bookmarkstore" }
cpython = { version = "0.4", default-features = false }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
types = { path = "../../../../lib/types" }

View File

@ -6,6 +6,6 @@ edition = "2018"
[dependencies]
clidispatch = { path = "../../../../lib/clidispatch" }
cliparser = { path = "../../../../lib/cliparser", features = ["python"] }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
pyconfigparser = { path = "../pyconfigparser" }

View File

@ -5,6 +5,6 @@ edition = "2018"
[dependencies]
clidispatch = { path = "../../../../lib/clidispatch" }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
hgcommands = { path = "../../../../lib/hgcommands" }

View File

@ -7,5 +7,5 @@ edition = "2018"
bytes = "0.4.11"
configparser = { path = "../../../../lib/configparser" }
cpython = { version = "0.4", default-features = false }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
util = { path = "../../../../lib/util" }

View File

@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2018"
[dependencies]
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
dag = { path = "../../../../lib/dag" }
anyhow = "1.0.20"

View File

@ -5,7 +5,7 @@ edition = "2018"
[dependencies]
bytes = "0.4"
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
edenapi = { path = "../../../../lib/edenapi" }
pyrevisionstore = { path = "../pyrevisionstore" }

View File

@ -5,7 +5,7 @@ edition = "2018"
[dependencies]
cpython = { version = "0.4", default-features = false }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
indexedlog = { path = "../../../../lib/indexedlog" }
metalog = { path = "../../../../lib/metalog" }
revisionstore = { path = "../../../../lib/revisionstore" }

View File

@ -5,5 +5,5 @@ edition = "2018"
[dependencies]
cpython = { version = "0.4", default-features = false }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
hgtime = { path = "../../../../lib/hgtime" }

View File

@ -9,7 +9,7 @@ python2 = []
python3 = []
[dependencies]
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
radixbuf = { path = "../../../../lib/radixbuf" }
anyhow = "1.0.20"
thiserror = "1.0.5"

View File

@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2018"
[dependencies]
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
lz4-pyframe = { path = "../../../../lib/lz4-pyframe" }

View File

@ -6,7 +6,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0.20"
bytes = { version = "0.4.11" }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
manifest = { path = "../../../../lib/manifest" }
manifest-tree = { path = "../../../../lib/manifest-tree" }

View File

@ -5,5 +5,5 @@ edition = "2018"
[dependencies]
cpython = { version = "0.4", default-features = false }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
metalog = { path = "../../../../lib/metalog" }

View File

@ -6,7 +6,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0.20"
byteorder = "1.2.7"
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
mutationstore = { path = "../../../../lib/mutationstore" }
thiserror = "1.0.5"

View File

@ -5,6 +5,6 @@ edition = "2018"
[dependencies]
cpython = { version = "0.4", default-features = false }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
nodemap = { path = "../../../../lib/nodemap" }
types = { path = "../../../../lib/types" }

View File

@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2018"
[dependencies]
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
pathmatcher = { path = "../../../../lib/pathmatcher" }
types = { path = "../../../../lib/types" }

View File

@ -5,7 +5,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0.20"
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
parking_lot = "0.9.0"
pyconfigparser = { path = "../pyconfigparser" }

View File

@ -5,6 +5,6 @@ edition = "2018"
[dependencies]
cpython = { version = "0.4", default-features = false }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
dag = { path = "../../../../lib/dag" }
pydag = { path = "../pydag" }

View File

@ -9,7 +9,7 @@ python2 = ["python27-sys"]
python3 = ["python3-sys"]
[dependencies]
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
lazy_static = "1"
mincode = { path = "../../../../lib/mincode" }

View File

@ -5,6 +5,6 @@ edition = "2018"
[dependencies]
anyhow = "1.0.20"
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
treestate = { path = "../../../../lib/treestate" }

View File

@ -5,5 +5,5 @@ edition = "2018"
[dependencies]
cpython = { version = "0.4", default-features = false }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
vlqencoding = { path = "../../../../lib/vlqencoding" }

View File

@ -6,7 +6,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0.20"
cpython = { version = "0.4", default-features = false }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
pathmatcher = { path = "../../../../lib/pathmatcher" }
pypathmatcher = { path = "../pypathmatcher" }
types = { path = "../../../../lib/types" }

View File

@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2018"
[dependencies]
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
cpython = { version = "0.4", default-features = false }
zstd = "0.4.18"
zstdelta = { path = "../../../../lib/zstdelta/" }

View File

@ -5,5 +5,5 @@ edition = "2018"
[dependencies]
cpython = { version = "0.4", default-features = false }
cpython-ext = { path = "../../../../lib/cpython-ext" }
cpython-ext = { path = "../../../../lib/cpython-ext", default-features = false }
zstore = { path = "../../../../lib/zstore" }

View File

@ -4,9 +4,9 @@ version = "0.1.0"
edition = "2018"
[features]
default = []
python2 = ["python27-sys"]
python3 = ["python3-sys"]
default = ["python2"]
python2 = ["python27-sys", "cpython/python27-sys"]
python3 = ["python3-sys", "cpython/python3-sys"]
[dependencies]
anyhow = "1.0.20"

View File

@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2018"
[features]
default = []
default = ["python2"]
python2 = ["bindings/python2", "pytracing/python2", "python27-sys", "cpython-ext/python2", "cpython/python27-sys"]
python3 = ["bindings/python3", "pytracing/python3", "python3-sys", "cpython-ext/python3", "cpython/python3-sys"]