Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New methods of building/installing PyThemis #1023

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6ed9bc3
Add make target pythemis_make_wheel
iamnotacake Sep 22, 2023
47e1050
Extend CI for Python wrapper
iamnotacake Sep 25, 2023
215fee9
Extend CI for Python wrapper (fix)
iamnotacake Sep 25, 2023
f94ae6c
Update Makefile and PyThemis CI configuration
iamnotacake Sep 25, 2023
df7ae05
Rename pythemis_install -> pythemis_old_install
iamnotacake Sep 25, 2023
cfd531f
Fix PyThemis CI config
iamnotacake Sep 25, 2023
8538edc
Partially working debian pythemis package building
iamnotacake Sep 26, 2023
d55f2e2
deb packaging, CI job
iamnotacake Sep 27, 2023
297a4fd
Make target for .deb building and installing
iamnotacake Sep 27, 2023
d539d20
Fix make pythemis_deb
iamnotacake Sep 27, 2023
cea6064
Fix make pythemis_deb
iamnotacake Sep 27, 2023
f5d66e1
Update debian pythemis building
iamnotacake Sep 28, 2023
ef9fed1
Rename pythemis_old_install -> pythemis_install
iamnotacake Sep 28, 2023
d7d253e
Update Makefile and CI config
iamnotacake Sep 29, 2023
f9e16bb
Comment RHEL-related PyThemis installation
iamnotacake Sep 29, 2023
a8c9869
Fix Makefile
iamnotacake Oct 2, 2023
e11d5de
Fix Makefile
iamnotacake Oct 2, 2023
ec4a4ab
Merge branch 'master' into anatolii/T2771-update-pythemis-install
iamnotacake Oct 2, 2023
428aa41
Updates after review
iamnotacake Oct 4, 2023
bbb8c46
Enable rpm pythemis packaging, minor updates
iamnotacake Oct 5, 2023
c1a094a
Update rpm_python make target
iamnotacake Oct 6, 2023
21dc437
make/install libthemis deb in Python CI job
iamnotacake Oct 9, 2023
29040f6
make clean now cleans Python artifacts as well
iamnotacake Oct 11, 2023
1c1c04e
Fix conditional building of c++/java packages in deb target
iamnotacake Oct 11, 2023
e0bdada
Pin log dependency to 0.4.17
iamnotacake Oct 16, 2023
065809b
Pin byteorder version to 1.4.3
iamnotacake Oct 16, 2023
ab37c05
Merge branch 'master' into anatolii/T2771-update-pythemis-install
iamnotacake Nov 20, 2023
e3ef5e3
Merge branch 'master' into anatolii/T2771-update-pythemis-install
iamnotacake Nov 27, 2023
9307a9e
Update changelog [skip ci]
iamnotacake Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions .github/workflows/test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,37 @@ jobs:
sudo make install
make prepare_tests_all
- name: Install PyThemis
run: sudo make pythemis_install
run: sudo make pythemis_old_install
- name: Run test suite
run: make test_python

unit-tests-venv:
name: Unit tests (venv install)
# TODO: Switch to something more fresh, Ubuntu 22.04 or Debian Bookworm
runs-on: ubuntu-20.04
steps:
- name: Install system dependencies
run: |
sudo sh -c 'echo "DEBIAN_FRONTEND=noninteractive" >> /etc/environment'
sudo apt update
sudo apt install --yes gcc make libssl-dev \
python3 python3-setuptools python3-pip python3-venv
- name: Check out code
uses: actions/checkout@v2
- name: Prepare Themis Core
run: |
make
sudo make install
make prepare_tests_all
- name: Create venv
run: mkdir /tmp/test_venv && python3 -m venv /tmp/test_venv
- name: Install PyThemis into venv
run: |
make pythemis_make_wheel
source /tmp/test_venv/bin/activate && make pythemis_install_wheel
- name: Run test suite
run: source /tmp/test_venv/bin/activate && make test_python

examples:
name: Code examples
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -84,7 +111,7 @@ jobs:
make
sudo make install
- name: Install PyThemis
run: sudo make pythemis_install
run: sudo make pythemis_old_install

- name: Test examples (Secure Cell)
if: always()
Expand Down
32 changes: 30 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ $(BUILD_PATH)/configure.mk:
# then increment LIBRARY_SO_VERSION as well, and update package names.
VERSION := $(shell test -d .git && git describe --tags || cat VERSION)
LIBRARY_SO_VERSION = 0
# Version in format X.Y.Z, without build number and commit hash
VERSION_SHORT := $(shell cat VERSION)

#----- Toolchain ---------------------------------------------------------------

Expand Down Expand Up @@ -598,15 +600,41 @@ ifdef PIP_VERSION
PIP_THEMIS_INSTALL := $(shell pip freeze |grep themis)
endif

pythemis_install: CMD = cd src/wrappers/themis/python/ && python3 setup.py install --record files3.txt
pythemis_install:
pythemis_old_install: CMD = cd src/wrappers/themis/python/ && python3 setup.py install --record files3.txt
Lagovas marked this conversation as resolved.
Show resolved Hide resolved
pythemis_old_install:
ifeq ($(PYTHON3_VERSION),)
@echo "python3 not found"
@exit 1
endif
@echo -n "pythemis install "
@$(BUILD_CMD_)

# If virtual env is detected, remove its bin path from PATH.
Lagovas marked this conversation as resolved.
Show resolved Hide resolved
# This way, setuptools and other wheel building dependencies will be taken from system modules dir,
# not from venv where they probably don't exist.
pythemis_make_wheel: CMD = cd src/wrappers/themis/python/ && [ -z "$$VIRTUAL_ENV" ] || PATH="$${PATH/$$VIRTUAL_ENV\/bin:/}" && python3 setup.py bdist_wheel
pythemis_make_wheel:
ifeq ($(PYTHON3_VERSION),)
@echo "python3 not found"
@exit 1
endif
@echo -n "pythemis make wheel "
@$(BUILD_CMD_)
@echo Result: src/wrappers/themis/python/dist/pythemis-$(VERSION_SHORT)-py2.py3-none-any.whl

pythemis_install_wheel: CMD = pip install src/wrappers/themis/python/dist/pythemis-$(VERSION_SHORT)-py2.py3-none-any.whl
pythemis_install_wheel:
ifeq ($(PYTHON3_VERSION),)
@echo "python3 not found"
@exit 1
endif
@echo -n "pythemis install wheel "
@$(BUILD_CMD_)

# pythemis_make_os_pkg: CMD = TODO
# pythemis_make_os_pkg:
# TODO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀


########################################################################
#
# Packaging Themis Core: Linux distributions
Expand Down
Loading