diff --git a/python/dev/RELEASE.md b/python/dev/RELEASE.md index d54fa0132d6d..03ec7678084c 100644 --- a/python/dev/RELEASE.md +++ b/python/dev/RELEASE.md @@ -28,8 +28,8 @@ First we're going to release a release candidate (RC) and publish it to the publ Make sure that you're on the version that you want to release. ```bash -export RC=rc1 -export VERSION=0.0.1${RC} +export RC=rc0 +export VERSION=0.0.1.${RC} export VERSION_WITHOUT_RC=${VERSION/rc?/} export VERSION_BRANCH=${VERSION_WITHOUT_RC//./-} diff --git a/python/pyiceberg/__init__.py b/python/pyiceberg/__init__.py index 13a83393a912..0c4a31db7a42 100644 --- a/python/pyiceberg/__init__.py +++ b/python/pyiceberg/__init__.py @@ -14,3 +14,6 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +from importlib import metadata + +__version__ = metadata.version(__package__) diff --git a/python/pyproject.toml b/python/pyproject.toml index a3e35bfc94a8..3d080332ca2b 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -17,7 +17,7 @@ [tool.poetry] name = "pyiceberg" -version = "0.0.1rc1" +version = "0.1.0.dev0" readme = "README.md" homepage = "https://iceberg.apache.org/" repository = "https://github.com/apache/iceberg/" diff --git a/python/tests/test_version.py b/python/tests/test_version.py new file mode 100644 index 000000000000..12a058e3f367 --- /dev/null +++ b/python/tests/test_version.py @@ -0,0 +1,29 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import re + +from pyiceberg import __version__ + +VERSION_REGEX = re.compile(r"^\d+.\d+.\d+(.(dev|rc)\d+)?$") + + +def test_version_format(): + # should be in the format of 0.14.0 or 0.14.0.dev0 + assert VERSION_REGEX.search(__version__) + + # RCs should work as well + assert VERSION_REGEX.search("0.1.0.rc0")