提交 9f0b2ca5 编写于 作者: J Jiajie Zhong

[python] Add support interpreter version 310 and 311-dev (#11170)

* Change version of package
* Fix tox error
* Change dev status to beta
* py4j not work on py{10,11} OS Windows

(cherry picked from commit 4d427ee2)
上级 8a12ae74
......@@ -61,7 +61,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install Dependences
......@@ -78,12 +78,20 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-18.04, macOS-latest, windows-latest]
# YAML parse `3.10` to `3.1`, so we have to add quotes for `'3.10'`, see also:
# https://github.com/actions/setup-python/issues/160#issuecomment-724485470
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', 3.11-dev]
os: [ubuntu-latest, macOS-latest, windows-latest]
# Skip because dependence [py4j](https://pypi.org/project/py4j/) not work on those environments
exclude:
- os: windows-latest
python-version: '3.10'
- os: windows-latest
python-version: 3.11-dev
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependences
......@@ -104,7 +112,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install Dependences
......@@ -123,7 +131,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install Dependences
......@@ -161,7 +169,7 @@ jobs:
-Pdocker,release -Ddocker.tag=ci \
-pl dolphinscheduler-standalone-server -am
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install Dependences
......
......@@ -45,6 +45,9 @@ pydolphinscheduler version
# 0.1.0
```
> NOTE: package apache-dolphinscheduler not work on above Python version 3.10(including itself) in Window operating system
> due to dependence [py4j](https://pypi.org/project/py4j/) not work on those environments.
Here we show you how to install and run a simple example of pydolphinscheduler
### Start Server And Run Example
......@@ -84,4 +87,4 @@ If you are interested in how to release **PyDolphinScheduler**, you could go and
## What's more
For more detail information, please go to see **PyDolphinScheduler** [document](https://dolphinscheduler.apache.org/python/index.html)
For more detail information, please go to see **PyDolphinScheduler** latest(unreleased) [document](https://dolphinscheduler.apache.org/python/dev/index.html)
......@@ -32,7 +32,7 @@ if sys.version_info[0] < 3:
logger = logging.getLogger(__name__)
version = "3.0.0"
version = "dev"
# Start package required
prod = [
......@@ -156,7 +156,7 @@ setup(
platforms=["any"],
classifiers=[
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
......@@ -169,6 +169,8 @@ setup(
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"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",
"Topic :: Software Development :: User Interfaces",
......
......@@ -20,7 +20,7 @@
import click
from click import echo
from pydolphinscheduler import __version__
import pydolphinscheduler
from pydolphinscheduler.core.configuration import (
get_single_config,
init_config_file,
......@@ -48,9 +48,9 @@ def version(part: str) -> None:
"""Show current version of pydolphinscheduler."""
if part:
idx = version_option_val.index(part)
echo(f"{__version__.split('.')[idx]}")
echo(f"{pydolphinscheduler.__version__.split('.')[idx]}")
else:
echo(f"{__version__}")
echo(f"{pydolphinscheduler.__version__}")
@cli.command()
......
......@@ -17,9 +17,11 @@
"""Test command line interface subcommand `version`."""
from unittest.mock import patch
import pytest
from pydolphinscheduler import __version__
import pydolphinscheduler
from pydolphinscheduler.cli.commands import cli
from tests.testing.cli import CliTestWrapper
......@@ -27,21 +29,27 @@ from tests.testing.cli import CliTestWrapper
def test_version():
"""Test whether subcommand `version` correct."""
cli_test = CliTestWrapper(cli, ["version"])
cli_test.assert_success(output=f"{__version__}")
cli_test.assert_success(output=f"{pydolphinscheduler.__version__}")
@pytest.mark.parametrize(
"part, idx",
"version, part, idx",
[
("major", 0),
("minor", 1),
("micro", 2),
("1.2.3", "major", 0),
("0.1.3", "minor", 1),
("3.1.0", "micro", 2),
("1.2.3-beta-1", "micro", 2),
("1.2.3-alpha", "micro", 2),
("1.2.3a2", "micro", 2),
("1.2.3b1", "micro", 2),
],
)
def test_version_part(part: str, idx: int):
@patch("pydolphinscheduler.__version__")
def test_version_part(mock_version, version: str, part: str, idx: int):
"""Test subcommand `version` option `--part`."""
mock_version.return_value = version
cli_test = CliTestWrapper(cli, ["version", "--part", part])
cli_test.assert_success(output=f"{__version__.split('.')[idx]}")
cli_test.assert_success(output=f"{pydolphinscheduler.__version__.split('.')[idx]}")
@pytest.mark.parametrize(
......
......@@ -16,7 +16,7 @@
# under the License.
[tox]
envlist = local-ci, auto-lint, lint, doc-build, doc-build-multi, code-test, integrate-test, local-integrate-test, py{36,37,38,39}
envlist = local-ci, auto-lint, lint, doc-build, doc-build-multi, code-test, integrate-test, local-integrate-test, py{36,37,38,39,310,311}
[testenv]
allowlist_externals =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册