From 4fe9a4732e805dc557ccff0b8064a0ee9eaebe80 Mon Sep 17 00:00:00 2001 From: Yanli Date: Thu, 25 Apr 2024 14:42:45 +0800 Subject: [PATCH 1/3] Use flit-core<3.9,>=3.4 to make PEP621 and PEP517 available in py3.6 --- .github/workflows/run_test.yaml | 10 ++------ README.md | 8 ------- pdm.lock | 12 +++++++++- pyproject.toml | 8 +++++-- setup.py | 41 --------------------------------- 5 files changed, 19 insertions(+), 60 deletions(-) delete mode 100644 setup.py diff --git a/.github/workflows/run_test.yaml b/.github/workflows/run_test.yaml index 82c6c5df..cb914a10 100644 --- a/.github/workflows/run_test.yaml +++ b/.github/workflows/run_test.yaml @@ -25,10 +25,7 @@ jobs: - name: Install nebulagraph-python from source and test dependencies run: | python -m pip install --upgrade pip - # remove pyproject.toml to avoid pdm install - rm pyproject.toml pip install . - pip install pip-tools pytest - name: Test with pytest run: | docker-compose -f docker-compose.yaml up -d @@ -42,7 +39,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: [3.7, 3.8, 3.9, '3.10', 3.11] + python-version: [3.8, 3.9, '3.10', 3.11] steps: - name: Maximize runner space @@ -62,10 +59,7 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install . - pdm install -G:dev - pdm install -G:test + pdm sync - name: lint run: pdm fmt-check - name: Test with pytest diff --git a/README.md b/README.md index 66c85343..264be68e 100644 --- a/README.md +++ b/README.md @@ -54,18 +54,10 @@ cd nebula-python - Install from source -> For python version >= 3.7.0 - ```bash pip install . ``` -> For python version >= 3.6.2, < 3.7.0 - -```bash -python3 setup.py install -``` - ## Quick Example: Connecting to GraphD Using Graph Client diff --git a/pdm.lock b/pdm.lock index 2aeba5f0..e852b47d 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev", "test", "example"] strategy = ["cross_platform"] lock_version = "4.4.1" -content_hash = "sha256:9cad27145feca517e2dbfffacaa8c3ad511404ba7721c599e3ac22f804a68de1" +content_hash = "sha256:8e768be230206a5d19371ee95f53cea982abd77cdbfe9644840aa079dd00ade8" [[package]] name = "anyio" @@ -376,6 +376,16 @@ files = [ {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, ] +[[package]] +name = "flit-core" +version = "3.8.0" +requires_python = ">=3.6" +summary = "Distribution-building parts of Flit. See flit package for more information" +files = [ + {file = "flit_core-3.8.0-py3-none-any.whl", hash = "sha256:64a29ec845164a6abe1136bf4bc5ae012bdfe758ed42fc7571a9059a7c80bd83"}, + {file = "flit_core-3.8.0.tar.gz", hash = "sha256:b305b30c99526df5e63d6022dd2310a0a941a187bd3884f4c8ef0418df6c39f3"}, +] + [[package]] name = "future" version = "1.0.0" diff --git a/pyproject.toml b/pyproject.toml index f876d484..1055be81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,8 +20,11 @@ license = {text = "Apache 2.0"} Homepage = "https://github.com/vesoft-inc/nebula-python" [build-system] -requires = ["pdm-backend"] -build-backend = "pdm.backend" +requires = ["flit-core<3.9,>=3.4"] +build-backend = "flit_core.buildapi" + +[tool.flit.module] +name = "nebula3" [tool.black] extend-exclude = ''' @@ -44,6 +47,7 @@ includes = ["nebula3"] [tool.pdm.dev-dependencies] dev = [ "black==22.8.0", + "flit-core<3.9,>=3.4", ] test = [ "pytest; python_full_version >= \"3.7.1\"", diff --git a/setup.py b/setup.py deleted file mode 100644 index 00c42f66..00000000 --- a/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2020 vesoft inc. All rights reserved. -# -# This source code is licensed under Apache 2.0 License. - -import sys -from setuptools import setup, find_packages -from pathlib import Path - -base_dir = Path(__file__).parent -long_description = (base_dir / "README.md").read_text() - -requirements = [ - "httplib2 >= 0.20.0", - "future >= 0.18.0", - "six >= 1.16.0", - "pytz >= 2021.1", - "httpx[http2] >= 0.22.0", -] - -if sys.version_info < (3, 7): - # httpcore-->anyio-->contextvars when it's < 3.7 - # while setuptools doesn't handle the dependency well - requirements.append("contextvars==2.4") - -setup( - name="nebula3-python", - version="3.8.0", - license="Apache 2.0", - author="vesoft-inc", - author_email="info@vesoft.com", - description="Python client for NebulaGraph V3.4", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/vesoft-inc/nebula-python", - install_requires=requirements, - packages=find_packages(), - platforms=["3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12"], - package_dir={"nebula3": "nebula3"}, -) From 99aa9ee503677add63512c9c833ca51049fd9fe7 Mon Sep 17 00:00:00 2001 From: Yanli Date: Thu, 25 Apr 2024 14:54:15 +0800 Subject: [PATCH 2/3] modify deps --- .github/workflows/run_test.yaml | 1 + pdm.lock | 12 +----------- pyproject.toml | 1 - 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/run_test.yaml b/.github/workflows/run_test.yaml index cb914a10..5005a0ee 100644 --- a/.github/workflows/run_test.yaml +++ b/.github/workflows/run_test.yaml @@ -25,6 +25,7 @@ jobs: - name: Install nebulagraph-python from source and test dependencies run: | python -m pip install --upgrade pip + pip install pytest pytest-cov pip install . - name: Test with pytest run: | diff --git a/pdm.lock b/pdm.lock index e852b47d..2aeba5f0 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev", "test", "example"] strategy = ["cross_platform"] lock_version = "4.4.1" -content_hash = "sha256:8e768be230206a5d19371ee95f53cea982abd77cdbfe9644840aa079dd00ade8" +content_hash = "sha256:9cad27145feca517e2dbfffacaa8c3ad511404ba7721c599e3ac22f804a68de1" [[package]] name = "anyio" @@ -376,16 +376,6 @@ files = [ {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, ] -[[package]] -name = "flit-core" -version = "3.8.0" -requires_python = ">=3.6" -summary = "Distribution-building parts of Flit. See flit package for more information" -files = [ - {file = "flit_core-3.8.0-py3-none-any.whl", hash = "sha256:64a29ec845164a6abe1136bf4bc5ae012bdfe758ed42fc7571a9059a7c80bd83"}, - {file = "flit_core-3.8.0.tar.gz", hash = "sha256:b305b30c99526df5e63d6022dd2310a0a941a187bd3884f4c8ef0418df6c39f3"}, -] - [[package]] name = "future" version = "1.0.0" diff --git a/pyproject.toml b/pyproject.toml index 1055be81..5eea404e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,6 @@ includes = ["nebula3"] [tool.pdm.dev-dependencies] dev = [ "black==22.8.0", - "flit-core<3.9,>=3.4", ] test = [ "pytest; python_full_version >= \"3.7.1\"", From 53c481ce4419a05d6701205755593f0083e01623 Mon Sep 17 00:00:00 2001 From: Yanli Date: Thu, 25 Apr 2024 15:21:00 +0800 Subject: [PATCH 3/3] add 3.12 to CI and modify description of pyproject --- .github/workflows/run_test.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_test.yaml b/.github/workflows/run_test.yaml index 5005a0ee..2274195e 100644 --- a/.github/workflows/run_test.yaml +++ b/.github/workflows/run_test.yaml @@ -40,7 +40,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: [3.8, 3.9, '3.10', 3.11] + python-version: [3.8, 3.9, '3.10', 3.11, 3.12] steps: - name: Maximize runner space diff --git a/pyproject.toml b/pyproject.toml index 5eea404e..fbe6cdd3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "nebula3-python" version = "3.8.0" -description = "Python client for NebulaGraph V3.4" +description = "Python client for NebulaGraph v3" authors = [ {name = "vesoft-inc", email = "info@vesoft.com"}, ]