tarantool / tarantool-python

Python client library for Tarantool
https://www.tarantool.io
BSD 2-Clause "Simplified" License
101 stars 46 forks source link

Package everything #248

Closed DifferentialOrange closed 2 years ago

DifferentialOrange commented 2 years ago

make: remove obsolete build commands

Part of #198

python: use explicit binaries version

Specify explicit Python 3 python3 and pip3 binaries everywhere to make commands more portable.

Part of #198

make: separate phony for each target

Part of #198

ci: remove source code with script

Remove connector source code for pure install tests with Python script. Python was chosen since it would work both on Windows and Linux.

Part of #198

make: target for test pure install

Part of #198

setup: update description

Part of #198

cd: pack pip package

Pack source code and wheel file with Github Actions. Result is stored as artifact.

Part of #198

ci: run tests with pip package

Part of #198

cd: publish pip package

Publish pip package on tag.

To test, comment "run only on tags" condition, change PYPI_REPO to testpypi and use ${{ secrets.TEST_PYPI_TOKEN }} as PYPI_TOKEN. You also need to remove 5dfdae5208256acf247ee27dbff52d23ca14185a commit changes about scm version and set some constant version: using local version identifiers [1] is not allowed by test.pypi.org.

  1. https://peps.python.org/pep-0440/

Part of #198

cd: pack RPM package

New RPM spec is based on RHEL RPM guide for Python packages [1] merged with results of python3 setup.py bdist_rpm --spec-only.

Beware that RPM name is changed based on recommendations for all mainstream distributives (for example, see [2]). Binary RPM is named python3-tarantool and source RPM is named python-tarantool. Before the patch they both were called tarantool-python (even though there wasn't new RPM releases since 0.6.5).

RPM is suitable for distributives with Python 3.7 or newer. See [3] about pre-Python 3.7 systems support.

  1. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/installing_and_using_dynamic_programming_languages/assembly_packaging-python-3-rpms_installing-and-using-dynamic-programming-languages
  2. https://fedoraproject.org/wiki/Packaging:Naming?rd=Packaging:NamingGuidelines#Python_source_package_naming
  3. https://github.com/tarantool/tarantool-python/issues/257

Part of #164, #198

test: make host more portable

Docker container localhost resolve fails to connect test suites to test Tarantool instances.

Part of #164, #198

ci: run tests with RPM package

See [1] about CentOS support. Fedora 37 is not tested yet since there is no Tarantool for it.

  1. https://github.com/tarantool/tarantool-python/issues/257

Part of #164, #198

cd: publish RPM package

Publish RPM package on tag.

To test, comment "run only on tags" condition, change RWS_REPO to https://rws-dev.tarantool.org.

See [1] about other OS support.

  1. https://github.com/tarantool/tarantool-python/issues/257

Closes #164, part of #198

cd: pack deb package

New deb spec files are based on stdeb plugin generated files [1] and Debian Style Guide for Packaging Python Libraries [2].

Beware that RPM name is changed based on recommendations for all mainstream distributives [2]. deb files are named with python3-tarantool prefix. Before the patch they were called tarantool-python (even though there wasn't new deb releases since 0.6.5).

deb is suitable for distributives with Python 3.7 or newer. See [3] about pre-Python 3.7 systems support.

Since deb requires changelog consistency to build, we generate a changelog entry for all nightly CI builds.

  1. https://pypi.org/project/stdeb/
  2. https://wiki.debian.org/Python/LibraryStyleGuide?action=show&redirect=Python%2FPackaging
  3. https://github.com/tarantool/tarantool-python/issues/257

Part of #198

fix: timezone offset with old pytz and pandas

It seems that older pandas and pytz distributions (for example, ones from Debian 10 deb repositories) are prone to issues when pytz timezone offset ignores current datetime value [1]. Using explicit localize is both valid in modern version and fixes the bug for older ones.

  1. https://stackoverflow.com/questions/11473721/weird-timezone-issue-with-pytz

Part of #198

ci: run tests with deb package

See [1] about older versions support. Only LTS Ubuntu versions are included here.

  1. https://github.com/tarantool/tarantool-python/issues/257

Part of #198

cd: publish deb package

Publish deb artifacts on tag.

To test, comment "run only on tags" condition, change RWS_REPO to https://rws-dev.tarantool.org.

See [1] about other OS support.

  1. https://github.com/tarantool/tarantool-python/issues/257

Closes #198

DifferentialOrange commented 2 years ago

"Specify explicit Python 3 python3 and pip3 binaries everywhere to make commands more portable." - why does it make commands more portable?

python3 is Python 3 binary for all systems which have Python 3 installed. For some configurations, python is python3 by default, sometimes you can make python to be python3 by installing python-is-python3 package or by messing with aliases (but I don't think we should enforce users to do so), but sometimes system has python2 for python. Same goes for pip (and I think I've met the case when python was python3 but pip was pip for Python 2).

Since our code supports only Python 3, we must ensure that everything runs with Python 3 only.