Skip to content

Fix module installation #241

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

Merged
merged 7 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
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
132 changes: 132 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,57 @@ jobs:
env:
TEST_TNT_SSL: ${{ matrix.tarantool == '2.10.0-1-gfa775b383-r486-linux-x86_64' }}

run_tests_with_install_linux:
# We want to run on external PRs, but not on our own internal
# PRs as they'll be run by the push to the branch.
#
# The main trick is described here:
# https://github.com/Dart-Code/Dart-Code/pull/2375
if: (github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository)
runs-on: ubuntu-20.04

strategy:
fail-fast: false

matrix:
tarantool:
- '2.10'
python:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
steps:
- name: Clone the connector repo
uses: actions/checkout@v2

- name: Remove connector source code
run: |
rm -rf tarantool
rm setup.py

- name: Install tarantool ${{ matrix.tarantool }}
uses: tarantool/setup-tarantool@v1
with:
tarantool-version: ${{ matrix.tarantool }}

- name: Setup Python for tests
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install the package with pip
run: pip install git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_REF_NAME

- name: Install test requirements
run: pip install -r requirements-test.txt

- name: Run tests
run: python -m unittest discover -v

run_tests_ce_windows:
# We want to run on external PRs, but not on our own internal
# PRs as they'll be run by the push to the branch.
Expand All @@ -163,11 +214,13 @@ jobs:
strategy:
fail-fast: false
matrix:
# Use reduced test matrix cause Windows pipelines are long.
tarantool:
- '1.10'
- '2.8'
- '2.10.0.g0a5ce0b9c-1'
python:
- '3.6'
- '3.10'

steps:
Expand Down Expand Up @@ -224,3 +277,82 @@ jobs:
run: |
cat tarantool.log || true
kill $(cat tarantool.pid) || true

run_tests_with_install_windows:
# We want to run on external PRs, but not on our own internal
# PRs as they'll be run by the push to the branch.
#
# The main trick is described here:
# https://github.com/Dart-Code/Dart-Code/pull/2375
if: (github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository)

runs-on: windows-2022

strategy:
fail-fast: false

matrix:
# Use reduced test matrix cause Windows pipelines are long.
tarantool:
- '2.10.0.g0a5ce0b9c-1'
python:
- '3.6'
- '3.10'
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any restrictions on the python version on Windows? Does it need to be documented?

Copy link
Member Author

@DifferentialOrange DifferentialOrange Oct 14, 2022

Choose a reason for hiding this comment

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

Well, there are no restrictions, it's more like "test only minimal required" since Windows pipelines are rather long and GitHub provides less Windows runners than Linux runners.

Copy link
Contributor

@oleg-jukovec oleg-jukovec Oct 14, 2022

Choose a reason for hiding this comment

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

I think then we need to add 3.6 (3.6, 3.10) since we claim it as a minimal supported version.

Anyway, a short comment will look good here, but up to you.

Copy link
Member Author

@DifferentialOrange DifferentialOrange Oct 14, 2022

Choose a reason for hiding this comment

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

That's a good comment, added.

steps:
- name: Clone the connector repo
uses: actions/checkout@v2

- name: Remove connector source code (main folder)
uses: JesseTG/[email protected]
with:
path: tarantool

- name: Remove connector source code (setup.py)
uses: JesseTG/[email protected]
with:
path: setup.py

- name: Setup Python for tests
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install the package with pip
run: pip install git+$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY@$env:GITHUB_REF_NAME

- name: Install test requirements
run: pip install -r requirements-test.txt

- name: Setup WSL for tarantool
uses: Vampire/setup-wsl@v1
with:
distribution: Ubuntu-20.04

- name: Install tarantool ${{ matrix.tarantool }} for WSL
shell: wsl-bash_Ubuntu-20.04 {0}
run: |
curl -L https://tarantool.io/release/2/installer.sh | bash -s
sudo apt install -y tarantool=${{ matrix.tarantool }} tarantool-dev=${{ matrix.tarantool }}

- name: Setup test tarantool instance
shell: wsl-bash_Ubuntu-20.04 {0}
run: |
rm -f ./tarantool.pid ./tarantool.log
TNT_PID=$(tarantool ./test/suites/lib/tarantool_python_ci.lua > tarantool.log 2>&1 & echo $!)
touch tarantool.pid
echo $TNT_PID > ./tarantool.pid

- name: Run tests
env:
REMOTE_TARANTOOL_HOST: localhost
REMOTE_TARANTOOL_CONSOLE_PORT: 3302
run: python -m unittest discover -v

- name: Stop test tarantool instance
if: ${{ always() }}
shell: wsl-bash_Ubuntu-20.04 {0}
run: |
cat tarantool.log || true
kill $(cat tarantool.pid) || true
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update documentation index, quick start and guide pages (#67).

### Fixed
- Package build (#238).

## 0.9.0 - 2022-06-20

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include README.rst
include README.txt
include setup.py
recursive-include src/tarantool/ *.py
recursive-include tarantool/ *.py
21 changes: 14 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import re

try:
from setuptools import setup
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
from distutils.core import setup, find_packages

# Extra commands for documentation management
cmdclass = {}
Expand Down Expand Up @@ -50,6 +50,14 @@ def read(*parts):
with codecs.open(filename, encoding='utf-8') as fp:
return fp.read()

def get_dependencies(file):
root = os.path.dirname(os.path.realpath(__file__))
requirements = os.path.join(root, file)
result = []
if os.path.isfile(requirements):
with open(requirements) as f:
return f.read().splitlines()
raise RuntimeError("Unable to get dependencies from file " + file)

def find_version(*file_paths):
version_file = read(*file_paths)
Expand All @@ -62,8 +70,9 @@ def find_version(*file_paths):

setup(
name="tarantool",
packages=["tarantool"],
package_dir={"tarantool": os.path.join("tarantool")},
packages=find_packages("."),
package_dir={"tarantool": "tarantool"},
include_package_data=True,
version=find_version('tarantool', '__init__.py'),
platforms=["all"],
author="tarantool-python AUTHORS",
Expand All @@ -82,8 +91,6 @@ def find_version(*file_paths):
],
cmdclass=cmdclass,
command_options=command_options,
install_requires=[
'msgpack>=1.0.4',
],
install_requires=get_dependencies('requirements.txt'),
python_requires='>=3',
)
Empty file.
Empty file.