diff --git a/.github/workflows/flyteidl-release.yml b/.github/workflows/flyteidl-release.yml index c69983ce05..448d660b80 100644 --- a/.github/workflows/flyteidl-release.yml +++ b/.github/workflows/flyteidl-release.yml @@ -20,12 +20,6 @@ jobs: run: | python -m pip install --upgrade pip pip install setuptools wheel twine - - name: Set version in python package - run: | - # from refs/tags/v1.2.3 get 1.2.3 - VERSION=$(echo $GITHUB_REF | sed 's#.*/v##') - VERSION=$VERSION make update_pyversion - shell: bash - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} diff --git a/flyteidl/Makefile b/flyteidl/Makefile index 8f51682707..2c7276fa98 100644 --- a/flyteidl/Makefile +++ b/flyteidl/Makefile @@ -43,14 +43,8 @@ doc_gen_deps: doc-requirements.txt: doc-requirements.in install-piptools $(call PIP_COMPILE,doc-requirements.in) -PLACEHOLDER := "__version__\ =\ \"0.0.0+develop\"" PLACEHOLDER_NPM := \"version\": \"0.0.0-develop\" -.PHONY: update_pyversion -update_pyversion: - grep "$(PLACEHOLDER)" "setup.py" - sed -i "s/$(PLACEHOLDER)/__version__ = \"${VERSION}\"/g" "setup.py" - .PHONY: update_npmversion update_npmversion: grep "$(PLACEHOLDER_NPM)" "package.json" diff --git a/flyteidl/pyproject.toml b/flyteidl/pyproject.toml new file mode 100644 index 0000000000..d5bc2facb7 --- /dev/null +++ b/flyteidl/pyproject.toml @@ -0,0 +1,78 @@ +[build-system] +requires = ["setuptools", "setuptools_scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "flyteidl" +dynamic = ["version"] +authors = [{ name = "Flyte Contributors", email = "admin@flyte.org" }] +description = "IDL for Flyte Platform" +license = { text = "Apache-2.0" } +readme = { file = "README.md", content-type = "text/markdown" } +requires-python = ">=3.8,<3.13" +dependencies = [ + 'googleapis-common-protos', + 'protoc_gen_swagger', + 'protobuf>=4.21.1,<5.0.0' + # Packages in here should rarely be pinned. This is because these + # packages (at the specified version) are required for project + # consuming this library. By pinning to a specific version you are the + # number of projects that can consume this or forcing them to + # upgrade/downgrade any dependencies pinned here in their project. + # + # Generally packages listed here are pinned to a major version range. + # + # e.g. + # Python FooBar package for foobaring + # pyfoobar>=1.0, <2.0 + # + # This will allow for any consuming projects to use this library as + # long as they have a version of pyfoobar equal to or greater than 1.x + # and less than 2.x installed. +] +classifiers = [ + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules" +] + +[project.urls] +Homepage = "https://github.com/flyteorg/flyte/tree/master/flyteidl" + +[tool.setuptools_scm] +root = "../" +tag_regex = '^(?:[\w-]+/)?(?P[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$' + +# https://github.com/pypa/setuptools/issues/3136 describes an extension to +# setuptools that would involve a simpler way to specify this, but while +# that does not happen we have to package the pyi files manually like so: +[tool.setuptools.package-data] +flyteidl = ["*.pyi", "**/*pyi"] + +[tool.setuptools.packages.find] +include = ["gen/pb_python/*"] +exclude = [ + "_templates", + "tmp", + "boilerplate", + "clients", + "docs", + "jsonschema", + "protos", + "scripts", + "gen/pb-cpp", + "gen/pb-go", + "gen/pb-java", + "gen/pb-js", + "gen/pb-rust", +] diff --git a/flyteidl/setup.py b/flyteidl/setup.py index 2f439ad360..1030e43304 100644 --- a/flyteidl/setup.py +++ b/flyteidl/setup.py @@ -1,45 +1,3 @@ from setuptools import setup, find_packages -__version__ = "0.0.0+develop" - -setup( - name='flyteidl', - version=__version__, - description='IDL for Flyte Platform', - url='https://github.com/flyteorg/flyte/tree/master/flyteidl', - long_description=open("README.md", encoding="utf-8").read(), - long_description_content_type="text/markdown", - maintainer='FlyteOrg', - maintainer_email='admin@flyte.org', - packages=find_packages('gen/pb_python'), - package_dir={'': 'gen/pb_python'}, - # https://github.com/pypa/setuptools/issues/3136 describes an extension to - # setuptools that would involve a simpler way to specify this, but while - # that does not happen we have to package the pyi files manually like so: - package_data={'flyteidl': ["*.pyi", "**/*.pyi"]}, - dependency_links=[], - install_requires=[ - 'googleapis-common-protos', - 'protoc_gen_swagger', - 'protobuf>=4.21.1,<5.0.0', - # Packages in here should rarely be pinned. This is because these - # packages (at the specified version) are required for project - # consuming this library. By pinning to a specific version you are the - # number of projects that can consume this or forcing them to - # upgrade/downgrade any dependencies pinned here in their project. - # - # Generally packages listed here are pinned to a major version range. - # - # e.g. - # Python FooBar package for foobaring - # pyfoobar>=1.0, <2.0 - # - # This will allow for any consuming projects to use this library as - # long as they have a version of pyfoobar equal to or greater than 1.x - # and less than 2.x installed. - ], - extras_require={ - ':python_version=="2.7"': ['typing>=3.6'], # allow typehinting PY2 - }, - license='Apache-2.0', -) +setup()