Skip to content

Commit

Permalink
ci: update 'check' script to use native extension
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Aug 24, 2021
1 parent d78e70a commit f49d461
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: |
pip install cffi pycparser
pip install --no-index --find-links=wheels google-crc32c
python ./scripts/check_cffi_crc32c.py
python ./scripts/check_crc32c_extension.py
- name: Run tests
run: |
pip install pytest
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
run: |
pip install cffi pycparser
pip install --no-index --find-links=wheels google-crc32c
python ./scripts/check_cffi_crc32c.py
python ./scripts/check_crc32c_extension.py
- name: Run tests
run: |
pip install pytest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: |
pip install cffi pycparser
pip install --no-index --find-links=wheels google-crc32c
python ./scripts/check_cffi_crc32c.py
python ./scripts/check_crc32c_extension.py
- name: Run tests
run: |
pip install pytest
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
run: |
pip install cffi pycparser
pip install --no-index --find-links=wheels google-crc32c
python ./scripts/check_cffi_crc32c.py
python ./scripts/check_crc32c_extension.py
- name: Run tests
run: |
pip install pytest
Expand Down
4 changes: 2 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pip install cffi pycparser
pip install --no-index --find-links=wheels google-crc32c
# Check the package, try and load the native library.
python ./scripts/check_cffi_crc32c.py
python ./scripts/check_crc32c_extension.py
```

On OS X:
Expand All @@ -37,7 +37,7 @@ pip install cffi pycparser
pip install --no-index --find-links=wheels google-crc32c
# Check the package, try and load the native library.
python ./scripts/check_cffi_crc32c.py
python ./scripts/check_crc32c_extension.py
```

On Windows:
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ def check(session):
session.install("--no-index", "--find-links=wheels", "google-crc32c")

# Run py.test against the unit tests.
session.run("python", "scripts/check_cffi_crc32c.py", *session.posargs)
session.run("python", "scripts/check_crc32c_extension.py", *session.posargs)
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from google_crc32c import _crc32c_cffi
from google_crc32c import _crc32c


def main():
print("_crc32c_cffi: {}".format(_crc32c_cffi))
print("_crc32c_cffi.lib: {}".format(_crc32c_cffi.lib))
print("dir(_crc32c_cffi.lib): {}".format(dir(_crc32c_cffi.lib)))
print("_crc32c: {}".format(_crc32c))
print("dir(_crc32c): {}".format(dir(_crc32c)))


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion scripts/manylinux/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ${PYTHON} -m venv venv
venv/bin/pip install ${WHEEL_FILE}

# Verify that the module is installed and peek at contents.
venv/bin/python scripts/check_cffi_crc32c.py
venv/bin/python scripts/check_crc32c_extension.py
unzip -l ${WHEEL_FILE}

# Clean up.
Expand Down
8 changes: 4 additions & 4 deletions scripts/osx/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ ${PYTHON36}/python3 -m venv venv36
curl https://bootstrap.pypa.io/get-pip.py | venv36/bin/python3
WHL=${REPO_ROOT}/wheels/google_crc32c-${PACKAGE_VERSION}-cp36-cp36m-macosx_10_9_x86_64.whl
venv36/bin/pip install ${WHL}
venv36/bin/python ${REPO_ROOT}/scripts/check_cffi_crc32c.py
venv36/bin/python ${REPO_ROOT}/scripts/check_crc32c_extension.py
${LISTDEPS_CMD} ${WHL}
rm -fr venv36

${PYTHON37}/python3 -m venv venv37
curl https://bootstrap.pypa.io/get-pip.py | venv37/bin/python3
WHL=${REPO_ROOT}/wheels/google_crc32c-${PACKAGE_VERSION}-cp37-cp37m-macosx_10_9_x86_64.whl
venv37/bin/pip install ${WHL}
venv37/bin/python ${REPO_ROOT}/scripts/check_cffi_crc32c.py
venv37/bin/python ${REPO_ROOT}/scripts/check_crc32c_extension.py
${LISTDEPS_CMD} ${WHL}
rm -fr venv37

${PYTHON38}/python3 -m venv venv38
curl https://bootstrap.pypa.io/get-pip.py | venv38/bin/python3
WHL=${REPO_ROOT}/wheels/google_crc32c-${PACKAGE_VERSION}-cp38-cp38-macosx_10_9_x86_64.whl
venv38/bin/pip install ${WHL}
venv38/bin/python ${REPO_ROOT}/scripts/check_cffi_crc32c.py
venv38/bin/python ${REPO_ROOT}/scripts/check_crc32c_extension.py
${LISTDEPS_CMD} ${WHL}
rm -fr venv38

Expand All @@ -74,6 +74,6 @@ rm -fr venv38
# curl https://bootstrap.pypa.io/get-pip.py | venv39/bin/python3
# WHL=${REPO_ROOT}/wheels/google_crc32c-${PACKAGE_VERSION}-cp39-cp39-macosx_10_9_x86_64.whl
# venv37/bin/pip install ${WHL}
# venv37/bin/python ${REPO_ROOT}/scripts/check_cffi_crc32c.py
# venv37/bin/python ${REPO_ROOT}/scripts/check_crc32c_extension.py
# ${LISTDEPS_CMD} ${WHL}
# rm -fr venv39
4 changes: 2 additions & 2 deletions scripts/windows/test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ FOR %%V IN (%PYTHON_VERSION%-32, %PYTHON_VERSION%-64) DO (
py -%%V -m pip install cffi pyparser
py -%%V -m pip install --no-index --find-links=wheels google-crc32c --force-reinstall

py -%%V ./scripts/check_cffi_crc32c.py
py -%%V ./scripts/check_crc32c_extension.py

py -%%V -m pip install pytest
py -%%V -m pytest tests
)
)

0 comments on commit f49d461

Please sign in to comment.