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

Deploy packages for CentOS 8 and Fedora 31 #164

Closed
Totktonada opened this issue Aug 21, 2020 · 2 comments · Fixed by #248
Closed

Deploy packages for CentOS 8 and Fedora 31 #164

Totktonada opened this issue Aug 21, 2020 · 2 comments · Fixed by #248
Assignees
Labels

Comments

@Totktonada
Copy link
Member

Known problems on CentOS 8

No python-setuptools and python-msgpack packages. There is python3-setuptools in the standard repositories and python3-msgpack in EPEL.

NB: How to better define dependency on EPEL in RPM spec? Or it is better ship python3-msgpack from our repositories?

See also tarantool/tarantool#4611 (comment)

Known problems on Fedora 31

Unlike CentOS 8 there are python-setuptools and python-msgpack aliases for python3-setuptools and python3-msgpack (however I think it would be better to depend on the latter ones directly).

But there is no python command, only python3, so python setup.py <...> commands fails.

@Totktonada Totktonada added the ci label Aug 21, 2020
Totktonada added a commit that referenced this issue Aug 21, 2020
Added Fedora 30, Ubuntu Eoan and Focal.

CentOS 8 and Fedora 31 are not added: we should resolve several build
problems first. Filed #164 regarding this.
Totktonada added a commit that referenced this issue Aug 21, 2020
Added Fedora 30, Ubuntu Eoan and Focal.

CentOS 8 and Fedora 31 are not added: we should resolve several build
problems first. Filed #164 regarding this.
@DifferentialOrange DifferentialOrange self-assigned this Sep 14, 2022
@DifferentialOrange
Copy link
Member

CentOS 8 is not relevant anymore.

Regarding python setup.py <...>: it seems that we need to remove direct setup.py calls:

While it is perfectly fine that users write setup.py files to configure a package build (e.g. to specify binary extensions or customize commands), on recent versions of setuptools, running python setup.py directly as a script is considered deprecated. This also means that users should avoid running commands directly via python setup.py .

See https://setuptools.pypa.io/en/latest/deprecated/commands.html

It doesn't mean that there won't be any python ... calls, but it's a good place to start.

@Totktonada
Copy link
Member Author

Also from this document:

Build [python -m build <...> is meant] will automatically download setuptools and build the package in an isolated environment.

In my understanding a network interaction during a package build/installation is a bad practice. At least it is banned by default in Gentoo: if a package tries to access a network at particular stages, it leads to sandbox rules violation error and fails the build.

So I would rather follow Fedora packaging guidelines for Python packages. I can't suggest anything definite, I have no experience here.

python setup.py <...> is likely not the best option for packaging too.


The recommendation regarding python -m build <...> may be valuable in context of the releasing guide for PyPI (but we should verify it in our case first).

DifferentialOrange added a commit that referenced this issue Nov 8, 2022
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.

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

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
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. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
Fedora docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
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. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
Fedora docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
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. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
Fedora docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
Publish RPM artifacts on tag.

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

See [1] about OS support.

1. #257

Closes #164, part of #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
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. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
Fedora docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
Publish RPM artifacts on tag.

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

See [1] about OS support.

1. #257

Closes #164, part of #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
Docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 8, 2022
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. #257

Closes #164, part of #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
Docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Closes #164, part of #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
Docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Closes #164, part of #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Closes #164, part of #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
Docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Closes #164, part of #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
Docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Closes #164, part of #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Closes #164, part of #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
Overview

  This release introduces the support of extention types (decimal, uuid,
  error, datetime, interval) in MessagePack, various IProto features
  support (feature discovery and push protocol) and major infrastructure
  updates (scm version computation, full documentation for external and
  internal API both as code docstrings and readthedocs HTML, deb and RPM
  packages, and everything is processed with CI/CD pipelines).

Breaking changes

  This release should not break any existing behavior.

New features

  - Backport ConnectionPool support for Python 3.6 (PR #245).
  - Support iproto feature discovery (#206).
  - Decimal type support (#203).
  - UUID type support (#202).
  - Support extra information for iproto errors (#232).
  - Error extension type support (#232).
  - Datetime type support and tarantool.Datetime type (#204, PR #252).

    Tarantool datetime objects are decoded to `tarantool.Datetime`
    type. `tarantool.Datetime` may be encoded to Tarantool datetime
    objects.

    You can create `tarantool.Datetime` objects either from
    MessagePack data or by using the same API as in Tarantool:

    ```python
    dt1 = tarantool.Datetime(year=2022, month=8, day=31,
                             hour=18, minute=7, sec=54,
                             nsec=308543321)

    dt2 = tarantool.Datetime(timestamp=1661969274)

    dt3 = tarantool.Datetime(timestamp=1661969274, nsec=308543321)
    ```

    `tarantool.Datetime` exposes `year`, `month`, `day`, `hour`,
    `minute`, `sec`, `nsec`, `timestamp` and `value` (integer epoch time
    with nanoseconds precision) properties if you need to convert
    `tarantool.Datetime` to any other kind of datetime object:

    ```python
    pdt = pandas.Timestamp(year=dt.year, month=dt.month, day=dt.day,
                           hour=dt.hour, minute=dt.minute, second=dt.sec,
                           microsecond=(dt.nsec // 1000),
                           nanosecond=(dt.nsec % 1000))
    ```

    Use `tzoffset` parameter to set up offset timezone:

    ```python
    dt = tarantool.Datetime(year=2022, month=8, day=31,
                            hour=18, minute=7, sec=54,
                            nsec=308543321, tzoffset=180)
    ```

    You may use `tzoffset` property to get timezone offset of a datetime
    object.

    Use `tz` parameter to set up timezone name:

    ```python
    dt = tarantool.Datetime(year=2022, month=8, day=31,
                            hour=18, minute=7, sec=54,
                            nsec=308543321, tz='Europe/Moscow')
    ```

    If both `tz` and `tzoffset` is specified, `tz` is used.

    You may use `tz` property to get timezone name of a datetime object.

    `timestamp_since_utc_epoch` is a parameter to set timestamp
    convertion behavior for timezone-aware datetimes.

    If ``False`` (default), behaves similar to Tarantool `datetime.new()`:

    ```python
    >>> dt = tarantool.Datetime(timestamp=1640995200, timestamp_since_utc_epoch=False)
    >>> dt
    datetime: Timestamp('2022-01-01 00:00:00'), tz: ""
    >>> dt.timestamp
    1640995200.0
    >>> dt = tarantool.Datetime(timestamp=1640995200, tz='Europe/Moscow',
    ...                         timestamp_since_utc_epoch=False)
    >>> dt
    datetime: Timestamp('2022-01-01 00:00:00+0300', tz='Europe/Moscow'), tz: "Europe/Moscow"
    >>> dt.timestamp
    1640984400.0
    ```

    Thus, if ``False``, datetime is computed from timestamp
    since epoch and then timezone is applied without any
    convertion. In that case, `dt.timestamp` won't be equal to
    initialization `timestamp` for all timezones with non-zero offset.

    If ``True``, behaves similar to `pandas.Timestamp`:

    ```python
    >>> dt = tarantool.Datetime(timestamp=1640995200, timestamp_since_utc_epoch=True)
    >>> dt
    datetime: Timestamp('2022-01-01 00:00:00'), tz: ""
    >>> dt.timestamp
    1640995200.0
    >>> dt = tarantool.Datetime(timestamp=1640995200, tz='Europe/Moscow',
    ...                         timestamp_since_utc_epoch=True)
    >>> dt
    datetime: Timestamp('2022-01-01 03:00:00+0300', tz='Europe/Moscow'), tz: "Europe/Moscow"
    >>> dt.timestamp
    1640995200.0
    ```

    Thus, if ``True``, datetime is computed in a way that `dt.timestamp`
    will always be equal to initialization `timestamp`.

  - Datetime interval type support and tarantool.Interval type (#229).

    Tarantool datetime interval objects are decoded to
    `tarantool.Interval` type. `tarantool.Interval` may be encoded to
    Tarantool interval objects.

    You can create `tarantool.Interval` objects either from
    MessagePack data or by using the same API as in Tarantool:

    ```python
    di = tarantool.Interval(year=-1, month=2, day=3,
                            hour=4, minute=-5, sec=6,
                            nsec=308543321,
                            adjust=tarantool.IntervalAdjust.NONE)
    ```

    Its attributes (same as in init API) are exposed, so you can
    use them if needed.

  - Datetime interval arithmetic support (#229).

    Valid operations:
    - `tarantool.Datetime` + `tarantool.Interval` = `tarantool.Datetime`
    - `tarantool.Datetime` - `tarantool.Interval` = `tarantool.Datetime`
    - `tarantool.Datetime` - `tarantool.Datetime` = `tarantool.Interval`
    - `tarantool.Interval` + `tarantool.Interval` = `tarantool.Interval`
    - `tarantool.Interval` - `tarantool.Interval` = `tarantool.Interval`

    Since `tarantool.Interval` could contain `month` and `year` fields
    and such operations could be ambiguous, you can use `adjust` field
    to tune the logic. The behavior is the same as in Tarantool, see
    [Interval arithmetic RFC](https://github.com/tarantool/tarantool/wiki/Datetime-Internals#interval-arithmetic).

    - `tarantool.IntervalAdjust.NONE` -- only truncation toward the end
      of month performed (default mode).

      ```python
      >>> dt = tarantool.Datetime(year=2022, month=3, day=31)
      datetime: Timestamp('2022-03-31 00:00:00'), tz: ""
      >>> di = tarantool.Interval(month=1, adjust=tarantool.IntervalAdjust.NONE)
      >>> dt + di
      datetime: Timestamp('2022-04-30 00:00:00'), tz: ""
      ```

    - `tarantool.IntervalAdjust.EXCESS` -- overflow mode, without any
      snap or truncation to the end of month, straight addition of days
      in month, stopping over month boundaries if there is less number
      of days.

      ```python
      >>> dt = tarantool.Datetime(year=2022, month=1, day=31)
      datetime: Timestamp('2022-01-31 00:00:00'), tz: ""
      >>> di = tarantool.Interval(month=1, adjust=tarantool.IntervalAdjust.EXCESS)
      >>> dt + di
      datetime: Timestamp('2022-03-02 00:00:00'), tz: ""
      ```

    - `tarantool.IntervalAdjust.LAST` -- mode when day snaps to the end
      of month, if happens.

      ```python
      >>> dt = tarantool.Datetime(year=2022, month=2, day=28)
      datetime: Timestamp('2022-02-28 00:00:00'), tz: ""
      >>> di = tarantool.Interval(month=1, adjust=tarantool.IntervalAdjust.LAST)
      >>> dt + di
      datetime: Timestamp('2022-03-31 00:00:00'), tz: ""
      ```

  - Full documentation of internal and external API (#67).

Bugfixes

  - Allow any MessagePack supported type as a request key (#240).
  - Make connection close idempotent (#250).

Infrastructure

  - Use git version to set package version (#238).
  - Test pip install from branch (PR #241).
  - Pack and publish pip, RPM and deb packages with GitHub Actions
    (#164, #198).
  - Publish on readthedocs with CI/CD (including PRs) (#67).
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
Docker container localhost resolve fails to connect test suites
to test Tarantool instances.

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
See [1] about CentOS support. Fedora 37 is not tested yet since there is
no Tarantool for it.

1. #257

Part of #164, #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
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. #257

Closes #164, part of #198
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
Overview

  This release introduces the support of extention types (decimal, uuid,
  error, datetime, interval) in MessagePack, various IProto features
  support (feature discovery and push protocol) and major infrastructure
  updates (scm version computation, full documentation for external and
  internal API both as code docstrings and readthedocs HTML, deb and RPM
  packages, and everything is processed with CI/CD pipelines).

Breaking changes

  This release should not break any existing behavior.

New features

  - Backport ConnectionPool support for Python 3.6 (PR #245).
  - Support iproto feature discovery (#206).
  - Decimal type support (#203).
  - UUID type support (#202).
  - Support extra information for iproto errors (#232).
  - Error extension type support (#232).
  - Datetime type support and tarantool.Datetime type (#204, PR #252).

    Tarantool datetime objects are decoded to `tarantool.Datetime`
    type. `tarantool.Datetime` may be encoded to Tarantool datetime
    objects.

    You can create `tarantool.Datetime` objects either from
    MessagePack data or by using the same API as in Tarantool:

    ```python
    dt1 = tarantool.Datetime(year=2022, month=8, day=31,
                             hour=18, minute=7, sec=54,
                             nsec=308543321)

    dt2 = tarantool.Datetime(timestamp=1661969274)

    dt3 = tarantool.Datetime(timestamp=1661969274, nsec=308543321)
    ```

    `tarantool.Datetime` exposes `year`, `month`, `day`, `hour`,
    `minute`, `sec`, `nsec`, `timestamp` and `value` (integer epoch time
    with nanoseconds precision) properties if you need to convert
    `tarantool.Datetime` to any other kind of datetime object:

    ```python
    pdt = pandas.Timestamp(year=dt.year, month=dt.month, day=dt.day,
                           hour=dt.hour, minute=dt.minute, second=dt.sec,
                           microsecond=(dt.nsec // 1000),
                           nanosecond=(dt.nsec % 1000))
    ```

    Use `tzoffset` parameter to set up offset timezone:

    ```python
    dt = tarantool.Datetime(year=2022, month=8, day=31,
                            hour=18, minute=7, sec=54,
                            nsec=308543321, tzoffset=180)
    ```

    You may use `tzoffset` property to get timezone offset of a datetime
    object.

    Use `tz` parameter to set up timezone name:

    ```python
    dt = tarantool.Datetime(year=2022, month=8, day=31,
                            hour=18, minute=7, sec=54,
                            nsec=308543321, tz='Europe/Moscow')
    ```

    If both `tz` and `tzoffset` is specified, `tz` is used.

    You may use `tz` property to get timezone name of a datetime object.

    `timestamp_since_utc_epoch` is a parameter to set timestamp
    convertion behavior for timezone-aware datetimes.

    If ``False`` (default), behaves similar to Tarantool `datetime.new()`:

    ```python
    >>> dt = tarantool.Datetime(timestamp=1640995200, timestamp_since_utc_epoch=False)
    >>> dt
    datetime: Timestamp('2022-01-01 00:00:00'), tz: ""
    >>> dt.timestamp
    1640995200.0
    >>> dt = tarantool.Datetime(timestamp=1640995200, tz='Europe/Moscow',
    ...                         timestamp_since_utc_epoch=False)
    >>> dt
    datetime: Timestamp('2022-01-01 00:00:00+0300', tz='Europe/Moscow'), tz: "Europe/Moscow"
    >>> dt.timestamp
    1640984400.0
    ```

    Thus, if ``False``, datetime is computed from timestamp
    since epoch and then timezone is applied without any
    convertion. In that case, `dt.timestamp` won't be equal to
    initialization `timestamp` for all timezones with non-zero offset.

    If ``True``, behaves similar to `pandas.Timestamp`:

    ```python
    >>> dt = tarantool.Datetime(timestamp=1640995200, timestamp_since_utc_epoch=True)
    >>> dt
    datetime: Timestamp('2022-01-01 00:00:00'), tz: ""
    >>> dt.timestamp
    1640995200.0
    >>> dt = tarantool.Datetime(timestamp=1640995200, tz='Europe/Moscow',
    ...                         timestamp_since_utc_epoch=True)
    >>> dt
    datetime: Timestamp('2022-01-01 03:00:00+0300', tz='Europe/Moscow'), tz: "Europe/Moscow"
    >>> dt.timestamp
    1640995200.0
    ```

    Thus, if ``True``, datetime is computed in a way that `dt.timestamp`
    will always be equal to initialization `timestamp`.

  - Datetime interval type support and tarantool.Interval type (#229).

    Tarantool datetime interval objects are decoded to
    `tarantool.Interval` type. `tarantool.Interval` may be encoded to
    Tarantool interval objects.

    You can create `tarantool.Interval` objects either from
    MessagePack data or by using the same API as in Tarantool:

    ```python
    di = tarantool.Interval(year=-1, month=2, day=3,
                            hour=4, minute=-5, sec=6,
                            nsec=308543321,
                            adjust=tarantool.IntervalAdjust.NONE)
    ```

    Its attributes (same as in init API) are exposed, so you can
    use them if needed.

  - Datetime interval arithmetic support (#229).

    Valid operations:
    - `tarantool.Datetime` + `tarantool.Interval` = `tarantool.Datetime`
    - `tarantool.Datetime` - `tarantool.Interval` = `tarantool.Datetime`
    - `tarantool.Datetime` - `tarantool.Datetime` = `tarantool.Interval`
    - `tarantool.Interval` + `tarantool.Interval` = `tarantool.Interval`
    - `tarantool.Interval` - `tarantool.Interval` = `tarantool.Interval`

    Since `tarantool.Interval` could contain `month` and `year` fields
    and such operations could be ambiguous, you can use `adjust` field
    to tune the logic. The behavior is the same as in Tarantool, see
    [Interval arithmetic RFC](https://github.com/tarantool/tarantool/wiki/Datetime-Internals#interval-arithmetic).

    - `tarantool.IntervalAdjust.NONE` -- only truncation toward the end
      of month performed (default mode).

      ```python
      >>> dt = tarantool.Datetime(year=2022, month=3, day=31)
      datetime: Timestamp('2022-03-31 00:00:00'), tz: ""
      >>> di = tarantool.Interval(month=1, adjust=tarantool.IntervalAdjust.NONE)
      >>> dt + di
      datetime: Timestamp('2022-04-30 00:00:00'), tz: ""
      ```

    - `tarantool.IntervalAdjust.EXCESS` -- overflow mode, without any
      snap or truncation to the end of month, straight addition of days
      in month, stopping over month boundaries if there is less number
      of days.

      ```python
      >>> dt = tarantool.Datetime(year=2022, month=1, day=31)
      datetime: Timestamp('2022-01-31 00:00:00'), tz: ""
      >>> di = tarantool.Interval(month=1, adjust=tarantool.IntervalAdjust.EXCESS)
      >>> dt + di
      datetime: Timestamp('2022-03-02 00:00:00'), tz: ""
      ```

    - `tarantool.IntervalAdjust.LAST` -- mode when day snaps to the end
      of month, if happens.

      ```python
      >>> dt = tarantool.Datetime(year=2022, month=2, day=28)
      datetime: Timestamp('2022-02-28 00:00:00'), tz: ""
      >>> di = tarantool.Interval(month=1, adjust=tarantool.IntervalAdjust.LAST)
      >>> dt + di
      datetime: Timestamp('2022-03-31 00:00:00'), tz: ""
      ```

  - Full documentation of internal and external API (#67).

Bugfixes

  - Allow any MessagePack supported type as a request key (#240).
  - Make connection close idempotent (#250).

Infrastructure

  - Use git version to set package version (#238).
  - Test pip install from branch (PR #241).
  - Pack and publish pip, RPM and deb packages with GitHub Actions
    (#164, #198).
  - Publish on readthedocs with CI/CD (including PRs) (#67).
DifferentialOrange added a commit that referenced this issue Nov 9, 2022
Overview

  This release introduces the support of extention types (decimal, uuid,
  error, datetime, interval) in MessagePack, various IProto features
  support (feature discovery and push protocol) and major infrastructure
  updates (scm version computation, full documentation for external and
  internal API both as code docstrings and readthedocs HTML, deb and RPM
  packages, and everything is processed with CI/CD pipelines).

Breaking changes

  This release should not break any existing behavior.

New features

  - Backport ConnectionPool support for Python 3.6 (PR #245).
  - Support iproto feature discovery (#206).
  - Decimal type support (#203).
  - UUID type support (#202).
  - Support extra information for iproto errors (#232).
  - Error extension type support (#232).
  - Datetime type support and tarantool.Datetime type (#204, PR #252).

    Tarantool datetime objects are decoded to `tarantool.Datetime`
    type. `tarantool.Datetime` may be encoded to Tarantool datetime
    objects.

    You can create `tarantool.Datetime` objects either from
    MessagePack data or by using the same API as in Tarantool:

    ```python
    dt1 = tarantool.Datetime(year=2022, month=8, day=31,
                             hour=18, minute=7, sec=54,
                             nsec=308543321)

    dt2 = tarantool.Datetime(timestamp=1661969274)

    dt3 = tarantool.Datetime(timestamp=1661969274, nsec=308543321)
    ```

    `tarantool.Datetime` exposes `year`, `month`, `day`, `hour`,
    `minute`, `sec`, `nsec`, `timestamp` and `value` (integer epoch time
    with nanoseconds precision) properties if you need to convert
    `tarantool.Datetime` to any other kind of datetime object:

    ```python
    pdt = pandas.Timestamp(year=dt.year, month=dt.month, day=dt.day,
                           hour=dt.hour, minute=dt.minute, second=dt.sec,
                           microsecond=(dt.nsec // 1000),
                           nanosecond=(dt.nsec % 1000))
    ```

    Use `tzoffset` parameter to set up offset timezone:

    ```python
    dt = tarantool.Datetime(year=2022, month=8, day=31,
                            hour=18, minute=7, sec=54,
                            nsec=308543321, tzoffset=180)
    ```

    You may use `tzoffset` property to get timezone offset of a datetime
    object.

    Use `tz` parameter to set up timezone name:

    ```python
    dt = tarantool.Datetime(year=2022, month=8, day=31,
                            hour=18, minute=7, sec=54,
                            nsec=308543321, tz='Europe/Moscow')
    ```

    If both `tz` and `tzoffset` is specified, `tz` is used.

    You may use `tz` property to get timezone name of a datetime object.

    `timestamp_since_utc_epoch` is a parameter to set timestamp
    convertion behavior for timezone-aware datetimes.

    If ``False`` (default), behaves similar to Tarantool `datetime.new()`:

    ```python
    >>> dt = tarantool.Datetime(timestamp=1640995200, timestamp_since_utc_epoch=False)
    >>> dt
    datetime: Timestamp('2022-01-01 00:00:00'), tz: ""
    >>> dt.timestamp
    1640995200.0
    >>> dt = tarantool.Datetime(timestamp=1640995200, tz='Europe/Moscow',
    ...                         timestamp_since_utc_epoch=False)
    >>> dt
    datetime: Timestamp('2022-01-01 00:00:00+0300', tz='Europe/Moscow'), tz: "Europe/Moscow"
    >>> dt.timestamp
    1640984400.0
    ```

    Thus, if ``False``, datetime is computed from timestamp
    since epoch and then timezone is applied without any
    convertion. In that case, `dt.timestamp` won't be equal to
    initialization `timestamp` for all timezones with non-zero offset.

    If ``True``, behaves similar to `pandas.Timestamp`:

    ```python
    >>> dt = tarantool.Datetime(timestamp=1640995200, timestamp_since_utc_epoch=True)
    >>> dt
    datetime: Timestamp('2022-01-01 00:00:00'), tz: ""
    >>> dt.timestamp
    1640995200.0
    >>> dt = tarantool.Datetime(timestamp=1640995200, tz='Europe/Moscow',
    ...                         timestamp_since_utc_epoch=True)
    >>> dt
    datetime: Timestamp('2022-01-01 03:00:00+0300', tz='Europe/Moscow'), tz: "Europe/Moscow"
    >>> dt.timestamp
    1640995200.0
    ```

    Thus, if ``True``, datetime is computed in a way that `dt.timestamp`
    will always be equal to initialization `timestamp`.

  - Datetime interval type support and tarantool.Interval type (#229).

    Tarantool datetime interval objects are decoded to
    `tarantool.Interval` type. `tarantool.Interval` may be encoded to
    Tarantool interval objects.

    You can create `tarantool.Interval` objects either from
    MessagePack data or by using the same API as in Tarantool:

    ```python
    di = tarantool.Interval(year=-1, month=2, day=3,
                            hour=4, minute=-5, sec=6,
                            nsec=308543321,
                            adjust=tarantool.IntervalAdjust.NONE)
    ```

    Its attributes (same as in init API) are exposed, so you can
    use them if needed.

  - Datetime interval arithmetic support (#229).

    Valid operations:
    - `tarantool.Datetime` + `tarantool.Interval` = `tarantool.Datetime`
    - `tarantool.Datetime` - `tarantool.Interval` = `tarantool.Datetime`
    - `tarantool.Datetime` - `tarantool.Datetime` = `tarantool.Interval`
    - `tarantool.Interval` + `tarantool.Interval` = `tarantool.Interval`
    - `tarantool.Interval` - `tarantool.Interval` = `tarantool.Interval`

    Since `tarantool.Interval` could contain `month` and `year` fields
    and such operations could be ambiguous, you can use `adjust` field
    to tune the logic. The behavior is the same as in Tarantool, see
    [Interval arithmetic RFC](https://github.com/tarantool/tarantool/wiki/Datetime-Internals#interval-arithmetic).

    - `tarantool.IntervalAdjust.NONE` -- only truncation toward the end
      of month performed (default mode).

      ```python
      >>> dt = tarantool.Datetime(year=2022, month=3, day=31)
      datetime: Timestamp('2022-03-31 00:00:00'), tz: ""
      >>> di = tarantool.Interval(month=1, adjust=tarantool.IntervalAdjust.NONE)
      >>> dt + di
      datetime: Timestamp('2022-04-30 00:00:00'), tz: ""
      ```

    - `tarantool.IntervalAdjust.EXCESS` -- overflow mode, without any
      snap or truncation to the end of month, straight addition of days
      in month, stopping over month boundaries if there is less number
      of days.

      ```python
      >>> dt = tarantool.Datetime(year=2022, month=1, day=31)
      datetime: Timestamp('2022-01-31 00:00:00'), tz: ""
      >>> di = tarantool.Interval(month=1, adjust=tarantool.IntervalAdjust.EXCESS)
      >>> dt + di
      datetime: Timestamp('2022-03-02 00:00:00'), tz: ""
      ```

    - `tarantool.IntervalAdjust.LAST` -- mode when day snaps to the end
      of month, if happens.

      ```python
      >>> dt = tarantool.Datetime(year=2022, month=2, day=28)
      datetime: Timestamp('2022-02-28 00:00:00'), tz: ""
      >>> di = tarantool.Interval(month=1, adjust=tarantool.IntervalAdjust.LAST)
      >>> dt + di
      datetime: Timestamp('2022-03-31 00:00:00'), tz: ""
      ```

  - Full documentation of internal and external API (#67).

Bugfixes

  - Allow any MessagePack supported type as a request key (#240).
  - Make connection close idempotent (#250).

Infrastructure

  - Use git version to set package version (#238).
  - Test pip install from branch (PR #241).
  - Pack and publish pip, RPM and deb packages with GitHub Actions
    (#164, #198).
  - Publish on readthedocs with CI/CD (including PRs) (#67).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants