diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index fdb427e3..a128ee56 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -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. @@ -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: @@ -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' + steps: + - name: Clone the connector repo + uses: actions/checkout@v2 + + - name: Remove connector source code (main folder) + uses: JesseTG/rm@v1.0.3 + with: + path: tarantool + + - name: Remove connector source code (setup.py) + uses: JesseTG/rm@v1.0.3 + 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f518c55..e02a335d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/MANIFEST.in b/MANIFEST.in index 4a9fa44b..fc2d7b26 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ include README.rst include README.txt include setup.py -recursive-include src/tarantool/ *.py +recursive-include tarantool/ *.py diff --git a/setup.py b/setup.py index 4aa0e7f1..9354dcc6 100755 --- a/setup.py +++ b/setup.py @@ -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 = {} @@ -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) @@ -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", @@ -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', ) diff --git a/tarantool/msgpack_ext/__init__.py b/tarantool/msgpack_ext/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tarantool/msgpack_ext/types/__init__.py b/tarantool/msgpack_ext/types/__init__.py new file mode 100644 index 00000000..e69de29b