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

Pythemis: introduce pyproject.toml #1006

Merged
Merged
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ _Code:_
- **Python**

- `pythemis.scomparator` and `pythemis.skeygen` are now imported with `from pythemis import *` ([#914](https://github.com/cossacklabs/themis/pull/914)).
- Pythemis supports `pyproject.toml` as a main way of building packages. The old `setup.py` is preserved for backwards compatibility ([#1006](https://github.com/cossacklabs/themis/pull/1006)).

- **Ruby**

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -598,7 +598,7 @@ 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: CMD = cd src/wrappers/themis/python/ && pip3 install .
Copy link
Collaborator

Choose a reason for hiding this comment

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

with which version of pip3 it works? if it doesn't work with pip version from our supported distros (centos 7/8, last 3 versions of ubuntu/debian), so we should add here pip3 install -U pip to update system version pip to newer

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, it requires additional testing, preferably not manual as I did. But I guess for now we can add this command just to be sure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm thinking, maybe we should add that command to the prepare_tests_all? Updating pip each time pythemis_install is called doesn't sound good to me. For example, maybe there are reasons why users don't want to update pip.

As I understand, only we use prepare_tests_all in our testing environments, so putting this command there should prevent problems with pip on our test machines. At the same time, if users, who install pythemis from the sources, will have to fix their environments in controlled way, if something goes wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

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

agree, better if we will add it in our own test environment. but starting installation via pip we should be sure that this approach supported by all supported OS, because approach with setup.py works for all of them

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmmm, another thought came to mind. The new pip versions (for example, in debian bookworm) don't want to install packages globally, so we will have to fix something (use virtual environments, pipx, etc). So, maybe it is better to postpone the change and fix only if it breaks?

Currently, it seems like a small change but it requires extensive testing on all our platforms.

pythemis_install:
ifeq ($(PYTHON3_VERSION),)
@echo "python3 not found"
7 changes: 7 additions & 0 deletions src/wrappers/themis/python/PKG-INFO
Original file line number Diff line number Diff line change
@@ -26,5 +26,12 @@ Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
40 changes: 40 additions & 0 deletions src/wrappers/themis/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "pythemis"
version = "0.14.0"
authors = [{ name = "CossackLabs", email = "dev@cossacklabs.com" }]
description = "Themis is multi-platform library with a high-level and easy-to-use cryptographic toolkit for data protection"
readme = "README.md"
requires-python = ">=3.2"
license = { file = "LICENSE" }
dependencies = ["six", "enum34; python_version<'3.4'"]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: POSIX :: BSD",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]

[tool.setuptools]
packages = ["pythemis"]
7 changes: 7 additions & 0 deletions src/wrappers/themis/python/setup.py
Original file line number Diff line number Diff line change
@@ -48,6 +48,13 @@
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],