Use travis's pypy binary instead of anaconda
This commit is contained in:
parent
f50d6d48e4
commit
016800ba4d
|
@ -26,9 +26,9 @@ jobs:
|
|||
- name: Minimum Stable
|
||||
python: "3.7"
|
||||
env: TRAVIS_RUST_VERSION=1.39.0
|
||||
- name: PyPy3.5 7.0 # Tested via anaconda PyPy (since travis's PyPy version is too old)
|
||||
python: "3.7"
|
||||
env: FEATURES="pypy" PATH="$PATH:/opt/anaconda/envs/pypy3/bin"
|
||||
- name: PyPy3.6
|
||||
python: "pypy3"
|
||||
env: FEATURES="pypy"
|
||||
allow_failures:
|
||||
- python: 3.9-dev
|
||||
|
||||
|
|
|
@ -12,28 +12,8 @@ if [[ $RUN_LINT == 1 ]]; then
|
|||
rustup component add rustfmt
|
||||
fi
|
||||
|
||||
### Setup PyPy ################################################################
|
||||
|
||||
if [[ $FEATURES == *"pypy"* ]]; then
|
||||
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
|
||||
/bin/bash Miniconda3-latest-Linux-x86_64.sh -f -b -p /opt/anaconda && \
|
||||
/opt/anaconda/bin/conda install --quiet --yes conda && \
|
||||
/opt/anaconda/bin/conda config --system --add channels conda-forge && \
|
||||
/opt/anaconda/bin/conda init bash && \
|
||||
/opt/anaconda/bin/conda create -n pypy3 pypy3.5 -y && \
|
||||
/opt/anaconda/envs/pypy3/bin/pypy3 -m ensurepip && \
|
||||
/opt/anaconda/envs/pypy3/bin/pypy3 -m pip install setuptools-rust pytest pytest-benchmark tox
|
||||
fi
|
||||
|
||||
### Setup python linker flags ##################################################
|
||||
|
||||
if [[ $FEATURES == *"pypy"* ]]; then
|
||||
PYTHON_BINARY="pypy3"
|
||||
else
|
||||
PYTHON_BINARY="python"
|
||||
fi
|
||||
|
||||
PYTHON_LIB=$($PYTHON_BINARY -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
|
||||
PYTHON_LIB=$(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
|
||||
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PYTHON_LIB:$HOME/rust/lib"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ if ! [[ $FEATURES == *"pypy"* ]]; then
|
|||
( cd pyo3-derive-backend; cargo test )
|
||||
else
|
||||
# check that pypy at least builds
|
||||
PYTHON_SYS_EXECUTABLE="/opt/anaconda/envs/pypy3/bin/pypy3" cargo build;
|
||||
cargo build;
|
||||
fi
|
||||
|
||||
if [[ $RUN_LINT == 1 ]]; then
|
||||
|
|
|
@ -77,7 +77,7 @@ fn get_time_tuple<'p>(py: Python<'p>, dt: &PyTime) -> &'p PyTuple {
|
|||
)
|
||||
}
|
||||
|
||||
#[cfg(Py_3_6)]
|
||||
#[cfg(all(Py_3_6, not(PyPy)))]
|
||||
#[pyfunction]
|
||||
fn get_time_tuple_fold<'p>(py: Python<'p>, dt: &PyTime) -> &'p PyTuple {
|
||||
PyTuple::new(
|
||||
|
@ -156,7 +156,7 @@ fn get_datetime_tuple<'p>(py: Python<'p>, dt: &PyDateTime) -> &'p PyTuple {
|
|||
)
|
||||
}
|
||||
|
||||
#[cfg(Py_3_6)]
|
||||
#[cfg(all(Py_3_6, not(PyPy)))]
|
||||
#[pyfunction]
|
||||
fn get_datetime_tuple_fold<'p>(py: Python<'p>, dt: &PyDateTime) -> &'p PyTuple {
|
||||
PyTuple::new(
|
||||
|
@ -230,8 +230,11 @@ fn datetime(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
|
|||
#[cfg(Py_3_6)]
|
||||
{
|
||||
m.add_wrapped(wrap_pyfunction!(time_with_fold))?;
|
||||
m.add_wrapped(wrap_pyfunction!(get_time_tuple_fold))?;
|
||||
m.add_wrapped(wrap_pyfunction!(get_datetime_tuple_fold))?;
|
||||
#[cfg(not(PyPy))]
|
||||
{
|
||||
m.add_wrapped(wrap_pyfunction!(get_time_tuple_fold))?;
|
||||
m.add_wrapped(wrap_pyfunction!(get_datetime_tuple_fold))?;
|
||||
}
|
||||
}
|
||||
|
||||
m.add_wrapped(wrap_pyfunction!(issue_219))?;
|
||||
|
|
|
@ -69,7 +69,7 @@ else:
|
|||
MAX_DATETIME = pdt.datetime(9999, 12, 31, 18, 59, 59)
|
||||
|
||||
PYPY = platform.python_implementation() == "PyPy"
|
||||
HAS_FOLD = getattr(pdt.datetime, "fold", False)
|
||||
HAS_FOLD = getattr(pdt.datetime, "fold", False) and not PYPY
|
||||
|
||||
|
||||
xfail_date_bounds = pytest.mark.xfail(
|
||||
|
|
|
@ -3,7 +3,7 @@ envlist = py35,
|
|||
py36,
|
||||
py37,
|
||||
py38,
|
||||
pypy35
|
||||
pypy36
|
||||
minversion = 3.4.0
|
||||
skip_missing_interpreters = true
|
||||
isolated_build = true
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::ffi::object::*;
|
||||
use crate::ffi::pyport::{Py_hash_t, Py_ssize_t};
|
||||
use crate::ffi::pyport::Py_ssize_t;
|
||||
use std::os::raw::{c_char, c_int};
|
||||
|
||||
#[cfg_attr(windows, link(name = "pythonXY"))]
|
||||
|
@ -81,7 +81,7 @@ extern "C" {
|
|||
mp: *mut PyObject,
|
||||
key: *mut PyObject,
|
||||
item: *mut PyObject,
|
||||
hash: Py_hash_t,
|
||||
hash: crate::ffi::Py_hash_t,
|
||||
) -> c_int;
|
||||
#[cfg_attr(PyPy, link_name = "PyPyDict_DelItem")]
|
||||
pub fn PyDict_DelItem(mp: *mut PyObject, key: *mut PyObject) -> c_int;
|
||||
|
@ -100,7 +100,7 @@ extern "C" {
|
|||
pos: *mut Py_ssize_t,
|
||||
key: *mut *mut PyObject,
|
||||
value: *mut *mut PyObject,
|
||||
hash: *mut Py_hash_t,
|
||||
hash: *mut crate::ffi::Py_hash_t,
|
||||
) -> c_int;
|
||||
#[cfg_attr(PyPy, link_name = "PyPyDict_Keys")]
|
||||
pub fn PyDict_Keys(mp: *mut PyObject) -> *mut PyObject;
|
||||
|
|
Loading…
Reference in a new issue