diff --git a/.circleci/config.yml b/.circleci/config.yml index e4a1441..15af75b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,8 +45,8 @@ jobs: name: "Verify proto" command: | set -ex - python3 -m pip install grpcio-tools mypy-protobuf "protobuf>=4,<5" - python protoc.py + python3 -m pip install -r ./python/dev-requirements.txt + python3 protoc.py linux_publish: docker: @@ -62,7 +62,7 @@ jobs: conda create -n build python=3.10 -y conda activate build cd python - python3 -m pip install grpcio-tools mypy-protobuf "protobuf>=4,<5" twine + python3 -m pip install -r dev-requirements.txt make build ls dist/*.whl python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} dist/*.whl @@ -78,4 +78,4 @@ workflows: publish: when: << pipeline.parameters.GHA_Action >> jobs: - - linux_publish \ No newline at end of file + - linux_publish diff --git a/.gitignore b/.gitignore index b0bdb25..a658635 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -OPENSOURCE-CLEAN REMOVE 2 -target -java-protos .idea build dist diff --git a/Cargo.toml b/Cargo.toml index a53b475..38e37d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ include = ["secretflowapis", "lib.rs", "build.rs"] [lib] -name = "sdc_apis" +name = "sdc_apis" path = "lib.rs" [dependencies] @@ -24,4 +24,3 @@ prost-wkt-types = "0.4" [build-dependencies] tonic-build = "0.9.2" prost-wkt-build = "0.4" - diff --git a/python/__init__.py b/python/__init__.py index fbb2ed2..138660e 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -1,2 +1,2 @@ #!/usr/bin/env python3 -# *_* coding: utf-8 *_* \ No newline at end of file +# *_* coding: utf-8 *_* diff --git a/python/dev-requirements.txt b/python/dev-requirements.txt new file mode 100644 index 0000000..34a607a --- /dev/null +++ b/python/dev-requirements.txt @@ -0,0 +1,4 @@ +-r requirements.txt +grpcio-tools +mypy-protobuf +twine \ No newline at end of file diff --git a/python/requirements.txt b/python/requirements.txt index d433a20..2f5f162 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1 +1 @@ -protobuf>=4, <5 \ No newline at end of file +protobuf>=4, <5 diff --git a/python/setup.py b/python/setup.py index 87ab0cc..f55d436 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,15 +1,23 @@ import setuptools -import os +from pathlib import Path +from datetime import date + +__version__ = "0.2.1.dev$$DATE$$" + + +def get_version(): + date_str = date.today().strftime("%Y%m%d") + return __version__.replace("$$DATE$$", date_str) def read(fname): - with open(os.path.join(os.path.dirname(__file__), fname)) as f: + with open(Path(__file__).resolve().parent / Path(fname)) as f: return f.read() setuptools.setup( name="sdc-apis", - version="0.2.1.dev240320", + version=get_version(), author="secretflow", author_email="secretflow-contact@service.alipay.com", description="SecretFlow Data Capsule apis proto generated python",