From d55752b86845b3da518c9f642917e56cb87b2b9d Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Thu, 6 Aug 2020 16:32:42 -0400 Subject: [PATCH 01/13] added pypi_packaging Signed-off-by: Curtis Mason --- .github/workflows/pypi-release.yml | 6 +++++- RELEASING.md | 10 +++++----- pypi_packaging.py | 30 ++++++++++++++++++++++++++++++ setup.py | 3 ++- 4 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 pypi_packaging.py diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index d6c8e73a..1455d4f3 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: "3.x" + python-version: "3.8" - name: Install build dependencies run: pip install -U setuptools wheel build - name: Build @@ -22,3 +22,7 @@ jobs: uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.pypi_password }} + - name: Install cloudevents and GitPython + run: pip install -U cloudevents 'GitPython==3.1.7' + - name: Create Tag + run: python pypi_packaging.py diff --git a/RELEASING.md b/RELEASING.md index f368b3ed..7d104a5d 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,17 +1,17 @@ # Releasing CloudEvents SDK for Python This repository is configured to automatically publish the corresponding [PyPI -package](https://pypi.org/project/cloudevents/) via GitHub Actions. +package](https://pypi.org/project/cloudevents/) and GitHub Tag via GitHub Actions. -To release a new CloudEvents SDK, contributors should bump the `version` in -[setup.py](setup.py)) to reflect the new release version. On merge, the action +To release a new CloudEvents SDK, contributors should bump `_LOCAL_PYPI_VERSION` in +[pypi_packaging.py](pypi_packaging.py)) to reflect the new release version. On merge, the action will automatically build and release to PyPI using [this PyPI GitHub Action](https://github.com/pypa/gh-action-pypi-publish). This action gets called on all pushes to master (such as a version branch being merged into master), but only releases a new version when the version number has changed. -After a version update is merged, maintainers are expected to manually create a -corresponding tag/release. +After a version update is merged, the script [pypi_packaging.py](pypi_packaging.py) +will create a tag for the new cloudevents version using `_LOCAL_PYPI_VERSION`. View the GitHub workflow [pypi-release.yml](.github/workflows/pypi-release.yml) for more information. diff --git a/pypi_packaging.py b/pypi_packaging.py new file mode 100644 index 00000000..ee5706bc --- /dev/null +++ b/pypi_packaging.py @@ -0,0 +1,30 @@ +from importlib.metadata import version +from git import Repo +import os + + +# FORMAT: 1.x.x +_LOCAL_PYPI_VERSION="1.0.0" + +def createTag(): + # metadata.version only works on python3.8 + # Make sure to install most updated version of package + published_pypi_version = version('cloudevents') + + # Check pypi and local package version match + if _LOCAL_PYPI_VERSION == published_pypi_version: + # Create tag + repo = Repo(os.getcwd()) + repo.create_tag(_LOCAL_PYPI_VERSION) + + # Push tag to origin master + origin = repo.remote() + origin.push(_LOCAL_PYPI_VERSION) + else: + # PyPI publish likely failed + exit(1) + + +if __name__ == '__main__': + createTag() + diff --git a/setup.py b/setup.py index 7dcb8ed2..0e7ce4fb 100644 --- a/setup.py +++ b/setup.py @@ -11,6 +11,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +from pypi_packaging import _LOCAL_PYPI_VERSION import setuptools @@ -40,5 +41,5 @@ ], package_dir={"": "cloudevents"}, packages=["http", "sdk"], - version="1.0.0", + version=_LOCAL_PYPI_VERSION, ) From d4b21daf8832b8e10b78b43478d3e7f5dab956dd Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Thu, 6 Aug 2020 16:40:20 -0400 Subject: [PATCH 02/13] reverted pypi-release Signed-off-by: Curtis Mason --- .github/workflows/pypi-release.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 1455d4f3..d6c8e73a 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: "3.8" + python-version: "3.x" - name: Install build dependencies run: pip install -U setuptools wheel build - name: Build @@ -22,7 +22,3 @@ jobs: uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.pypi_password }} - - name: Install cloudevents and GitPython - run: pip install -U cloudevents 'GitPython==3.1.7' - - name: Create Tag - run: python pypi_packaging.py From 783fa6396dbb89ef94e153dc64d5df2ea35dc01f Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Thu, 6 Aug 2020 16:41:15 -0400 Subject: [PATCH 03/13] added pypi_package workflow Signed-off-by: Curtis Mason --- .github/workflows/pypi-release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index d6c8e73a..1455d4f3 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: "3.x" + python-version: "3.8" - name: Install build dependencies run: pip install -U setuptools wheel build - name: Build @@ -22,3 +22,7 @@ jobs: uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.pypi_password }} + - name: Install cloudevents and GitPython + run: pip install -U cloudevents 'GitPython==3.1.7' + - name: Create Tag + run: python pypi_packaging.py From f804a1fb0aea23541bd6c236f697ab4dd068c00f Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Thu, 6 Aug 2020 17:05:33 -0400 Subject: [PATCH 04/13] added gitpython dependency Signed-off-by: Curtis Mason --- .github/workflows/pypi-release.yml | 2 +- pypi_packaging.py | 5 ++--- requirements/publish.txt | 1 + tox.ini | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 requirements/publish.txt diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 1455d4f3..349ca95b 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: "3.8" + python-version: "3.x" - name: Install build dependencies run: pip install -U setuptools wheel build - name: Build diff --git a/pypi_packaging.py b/pypi_packaging.py index ee5706bc..fdb5859e 100644 --- a/pypi_packaging.py +++ b/pypi_packaging.py @@ -1,15 +1,14 @@ -from importlib.metadata import version +import pkg_resources from git import Repo import os - # FORMAT: 1.x.x _LOCAL_PYPI_VERSION="1.0.0" def createTag(): # metadata.version only works on python3.8 # Make sure to install most updated version of package - published_pypi_version = version('cloudevents') + published_pypi_version = pkg_resources.get_distribution("cloudevents").version # Check pypi and local package version match if _LOCAL_PYPI_VERSION == published_pypi_version: diff --git a/requirements/publish.txt b/requirements/publish.txt new file mode 100644 index 00000000..bcca747e --- /dev/null +++ b/requirements/publish.txt @@ -0,0 +1 @@ +GitPython==3.1.7 \ No newline at end of file diff --git a/tox.ini b/tox.ini index e975ea4c..49745e41 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ usedevelop = True deps = -r{toxinidir}/requirements/test.txt -r{toxinidir}/requirements/docs.txt + -r{toxinidir}/requirements/publish.txt setenv = PYTESTARGS = -v -s --tb=long --cov=cloudevents commands = pytest {env:PYTESTARGS} {posargs} From d77ca2564ab51c30534c9025b7f7cc16629edd4b Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Thu, 6 Aug 2020 17:11:31 -0400 Subject: [PATCH 05/13] added git import in createTag function Signed-off-by: Curtis Mason --- pypi_packaging.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pypi_packaging.py b/pypi_packaging.py index fdb5859e..f41893d8 100644 --- a/pypi_packaging.py +++ b/pypi_packaging.py @@ -1,14 +1,18 @@ import pkg_resources -from git import Repo import os # FORMAT: 1.x.x -_LOCAL_PYPI_VERSION="1.0.0" +_LOCAL_PYPI_VERSION = "1.0.0" + def createTag(): + from git import Repo + # metadata.version only works on python3.8 - # Make sure to install most updated version of package - published_pypi_version = pkg_resources.get_distribution("cloudevents").version + # Make sure to install most updated version of package + published_pypi_version = pkg_resources.get_distribution( + "cloudevents" + ).version # Check pypi and local package version match if _LOCAL_PYPI_VERSION == published_pypi_version: @@ -24,6 +28,5 @@ def createTag(): exit(1) -if __name__ == '__main__': +if __name__ == "__main__": createTag() - From a0da1a3206daf8f0d716007c04251e25d616adc1 Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Fri, 7 Aug 2020 13:31:52 -0400 Subject: [PATCH 06/13] Updated RELEASING.md and implemented pypi_config in pypi_packaging.pg Signed-off-by: Curtis Mason Signed-off-by: Curtis Mason --- RELEASING.md | 16 ++++++++++++---- pypi_packaging.py | 18 +++++++++++++----- setup.py | 6 +++--- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index 7d104a5d..a4f7686a 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -3,15 +3,23 @@ This repository is configured to automatically publish the corresponding [PyPI package](https://pypi.org/project/cloudevents/) and GitHub Tag via GitHub Actions. -To release a new CloudEvents SDK, contributors should bump `_LOCAL_PYPI_VERSION` in -[pypi_packaging.py](pypi_packaging.py)) to reflect the new release version. On merge, the action +To release a new CloudEvents SDK, contributors should bump `pypi_config['version_target']` in +[pypi_packaging.py](pypi_packaging.py) to reflect the new release version. On merge, the action will automatically build and release to PyPI using [this PyPI GitHub Action](https://github.com/pypa/gh-action-pypi-publish). This action gets called on all pushes to master (such as a version branch being merged -into master), but only releases a new version when the version number has changed. +into master), but only releases a new version when the version number has changed. Note, +this action assumes pushes to master are version updates. Consequently, +[pypi-release.yml](.github/workflows/pypi-release.yml) will fail if you attempt to +push to master without updating `pypi_config['version_target']` in +[pypi_packaging.py](pypi_packaging.py) so don't forget to do so. After a version update is merged, the script [pypi_packaging.py](pypi_packaging.py) -will create a tag for the new cloudevents version using `_LOCAL_PYPI_VERSION`. +will create a GitHub tag for the new cloudevents version using `pypi_config['version_target']`. +The script fails if `pypi_config['version_target']` and the local pypi version for +cloudevents are out of sync. For this reason, (pypi-release.yml)(.github/workflows/pypi-release.yml) +first must update pypi, and then download the recently updated pypi version of cloudevents +for [pypi_packaging.py](pypi_packaging.py) not to fail. View the GitHub workflow [pypi-release.yml](.github/workflows/pypi-release.yml) for more information. diff --git a/pypi_packaging.py b/pypi_packaging.py index f41893d8..f006a948 100644 --- a/pypi_packaging.py +++ b/pypi_packaging.py @@ -2,7 +2,10 @@ import os # FORMAT: 1.x.x -_LOCAL_PYPI_VERSION = "1.0.0" +pypi_config = { + "version_target": "1.0.0", + "package_name": "cloudevents", +} def createTag(): @@ -11,20 +14,25 @@ def createTag(): # metadata.version only works on python3.8 # Make sure to install most updated version of package published_pypi_version = pkg_resources.get_distribution( - "cloudevents" + pypi_config["package_name"] ).version # Check pypi and local package version match - if _LOCAL_PYPI_VERSION == published_pypi_version: + if pypi_config["version_target"] == published_pypi_version: # Create tag repo = Repo(os.getcwd()) - repo.create_tag(_LOCAL_PYPI_VERSION) + repo.create_tag(pypi_config["version_target"]) # Push tag to origin master origin = repo.remote() - origin.push(_LOCAL_PYPI_VERSION) + origin.push(pypi_config["version_target"]) + else: # PyPI publish likely failed + print( + f"Expected {pypi_config['package_name']}=={pypi_config['version_target']} " + f"but found {pypi_config['package_name']}=={published_pypi_version}" + ) exit(1) diff --git a/setup.py b/setup.py index 0e7ce4fb..b0b5c380 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -from pypi_packaging import _LOCAL_PYPI_VERSION +from pypi_packaging import pypi_config import setuptools @@ -22,7 +22,7 @@ long_description = (here / "README.md").read_text(encoding="utf-8") setuptools.setup( - name="cloudevents", + name=pypi_config["package_name"], summary="CloudEvents SDK Python", long_description_content_type="text/markdown", long_description=long_description, @@ -41,5 +41,5 @@ ], package_dir={"": "cloudevents"}, packages=["http", "sdk"], - version=_LOCAL_PYPI_VERSION, + version=pypi_config["version_target"], ) From d5aead78179800f1b6b8999b533e2a64a36e4b55 Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Fri, 7 Aug 2020 13:42:47 -0400 Subject: [PATCH 07/13] Fixed some docs Signed-off-by: Curtis Mason Signed-off-by: Curtis Mason --- RELEASING.md | 4 ++-- pypi_packaging.py | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index a4f7686a..dffa5774 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -18,8 +18,8 @@ After a version update is merged, the script [pypi_packaging.py](pypi_packaging. will create a GitHub tag for the new cloudevents version using `pypi_config['version_target']`. The script fails if `pypi_config['version_target']` and the local pypi version for cloudevents are out of sync. For this reason, (pypi-release.yml)(.github/workflows/pypi-release.yml) -first must update pypi, and then download the recently updated pypi version of cloudevents -for [pypi_packaging.py](pypi_packaging.py) not to fail. +first must upload the new cloudevents pypi package, and then download the recently updated pypi +cloudevents package for [pypi_packaging.py](pypi_packaging.py) not to fail. View the GitHub workflow [pypi-release.yml](.github/workflows/pypi-release.yml) for more information. diff --git a/pypi_packaging.py b/pypi_packaging.py index f006a948..0d7b0bcd 100644 --- a/pypi_packaging.py +++ b/pypi_packaging.py @@ -11,19 +11,18 @@ def createTag(): from git import Repo - # metadata.version only works on python3.8 - # Make sure to install most updated version of package + # Get local pypi cloudevents version published_pypi_version = pkg_resources.get_distribution( pypi_config["package_name"] ).version - # Check pypi and local package version match + # Ensure pypi and local package versions match if pypi_config["version_target"] == published_pypi_version: - # Create tag + # Create local git tag repo = Repo(os.getcwd()) repo.create_tag(pypi_config["version_target"]) - # Push tag to origin master + # Push git tag to remote master origin = repo.remote() origin.push(pypi_config["version_target"]) From bd03dccd3e215f3c93f83eb968dfe54c79242aed Mon Sep 17 00:00:00 2001 From: Curtis Mason <31265687+cumason123@users.noreply.github.com> Date: Mon, 10 Aug 2020 18:09:39 -0400 Subject: [PATCH 08/13] Update .github/workflows/pypi-release.yml Co-authored-by: Dustin Ingram Signed-off-by: Curtis Mason --- .github/workflows/pypi-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 349ca95b..7611e8e3 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -23,6 +23,6 @@ jobs: with: password: ${{ secrets.pypi_password }} - name: Install cloudevents and GitPython - run: pip install -U cloudevents 'GitPython==3.1.7' + run: pip install -r requirements/publish.txt - name: Create Tag run: python pypi_packaging.py From 6738d9307ae8b14fc68e8500ad64e8659475fe2f Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Mon, 10 Aug 2020 15:48:00 -0700 Subject: [PATCH 09/13] added __version__ Signed-off-by: Curtis Mason --- RELEASING.md | 12 ++++++------ cloudevents/__init__.py | 1 + pypi_packaging.py | 20 +++++++++++++++++++- setup.py | 3 +-- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index dffa5774..140323ea 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -3,20 +3,20 @@ This repository is configured to automatically publish the corresponding [PyPI package](https://pypi.org/project/cloudevents/) and GitHub Tag via GitHub Actions. -To release a new CloudEvents SDK, contributors should bump `pypi_config['version_target']` in -[pypi_packaging.py](pypi_packaging.py) to reflect the new release version. On merge, the action +To release a new CloudEvents SDK, contributors should bump `__version__` in +[cloudevents](cloudevents/__init__.py) to reflect the new release version. On merge, the action will automatically build and release to PyPI using [this PyPI GitHub Action](https://github.com/pypa/gh-action-pypi-publish). This action gets called on all pushes to master (such as a version branch being merged into master), but only releases a new version when the version number has changed. Note, this action assumes pushes to master are version updates. Consequently, [pypi-release.yml](.github/workflows/pypi-release.yml) will fail if you attempt to -push to master without updating `pypi_config['version_target']` in -[pypi_packaging.py](pypi_packaging.py) so don't forget to do so. +push to master without updating `__version__` in +[cloudevents](cloudevents/__init__.py) so don't forget to do so. After a version update is merged, the script [pypi_packaging.py](pypi_packaging.py) -will create a GitHub tag for the new cloudevents version using `pypi_config['version_target']`. -The script fails if `pypi_config['version_target']` and the local pypi version for +will create a GitHub tag for the new cloudevents version using `__version__`. +The script fails if `__version__` and the local pypi version for cloudevents are out of sync. For this reason, (pypi-release.yml)(.github/workflows/pypi-release.yml) first must upload the new cloudevents pypi package, and then download the recently updated pypi cloudevents package for [pypi_packaging.py](pypi_packaging.py) not to fail. diff --git a/cloudevents/__init__.py b/cloudevents/__init__.py index e69de29b..5becc17c 100644 --- a/cloudevents/__init__.py +++ b/cloudevents/__init__.py @@ -0,0 +1 @@ +__version__ = "1.0.0" diff --git a/pypi_packaging.py b/pypi_packaging.py index 0d7b0bcd..b532d2e9 100644 --- a/pypi_packaging.py +++ b/pypi_packaging.py @@ -1,9 +1,27 @@ +import codecs + import pkg_resources import os + +def read(rel_path): + here = os.path.abspath(os.path.dirname(__file__)) + with codecs.open(os.path.join(here, rel_path), 'r') as fp: + return fp.read() + + +def get_version(rel_path): + for line in read(rel_path).splitlines(): + if line.startswith('__version__'): + delim = '"' if '"' in line else "'" + return line.split(delim)[1] + else: + raise RuntimeError("Unable to find version string.") + + # FORMAT: 1.x.x pypi_config = { - "version_target": "1.0.0", + "version_target": get_version("cloudevents/__init__.py"), "package_name": "cloudevents", } diff --git a/setup.py b/setup.py index b0b5c380..5a956356 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,6 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", ], - package_dir={"": "cloudevents"}, - packages=["http", "sdk"], + packages=["cloudevents"], version=pypi_config["version_target"], ) From 31c0922f0a4ef5afa5021244157e37e65cad9f4e Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Mon, 10 Aug 2020 15:50:55 -0700 Subject: [PATCH 10/13] lint change Signed-off-by: Curtis Mason --- pypi_packaging.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pypi_packaging.py b/pypi_packaging.py index b532d2e9..8cb74862 100644 --- a/pypi_packaging.py +++ b/pypi_packaging.py @@ -6,13 +6,13 @@ def read(rel_path): here = os.path.abspath(os.path.dirname(__file__)) - with codecs.open(os.path.join(here, rel_path), 'r') as fp: + with codecs.open(os.path.join(here, rel_path), "r") as fp: return fp.read() def get_version(rel_path): for line in read(rel_path).splitlines(): - if line.startswith('__version__'): + if line.startswith("__version__"): delim = '"' if '"' in line else "'" return line.split(delim)[1] else: From ab0173c10a7b0e25207ec3fa2c4088182ed2aa97 Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Mon, 10 Aug 2020 16:12:20 -0700 Subject: [PATCH 11/13] reinstalling cloudevents in workflow Signed-off-by: Curtis Mason --- .github/workflows/pypi-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 7611e8e3..412fe332 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -24,5 +24,6 @@ jobs: password: ${{ secrets.pypi_password }} - name: Install cloudevents and GitPython run: pip install -r requirements/publish.txt + run: pip install cloudevents -U - name: Create Tag run: python pypi_packaging.py From af73fbb2314b98beac0cb8b7bb131bb35cd40dd8 Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Mon, 10 Aug 2020 17:01:09 -0700 Subject: [PATCH 12/13] added cloudevents to publish.txt Signed-off-by: Curtis Mason --- .github/workflows/pypi-release.yml | 5 ++--- requirements/publish.txt | 3 ++- setup.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 412fe332..1a9fbc8c 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -22,8 +22,7 @@ jobs: uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.pypi_password }} - - name: Install cloudevents and GitPython - run: pip install -r requirements/publish.txt - run: pip install cloudevents -U + - name: Install GitPython and cloudevents for pypi_packaging + run: pip install -U -r requirements/publish.txt - name: Create Tag run: python pypi_packaging.py diff --git a/requirements/publish.txt b/requirements/publish.txt index bcca747e..d78d65b2 100644 --- a/requirements/publish.txt +++ b/requirements/publish.txt @@ -1 +1,2 @@ -GitPython==3.1.7 \ No newline at end of file +GitPython==3.1.7 +cloudevents \ No newline at end of file diff --git a/setup.py b/setup.py index 5a956356..053ea6cb 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ # under the License. from pypi_packaging import pypi_config -import setuptools +from setuptools import setup, find_packages import pathlib @@ -21,7 +21,7 @@ here = pathlib.Path(__file__).parent.resolve() long_description = (here / "README.md").read_text(encoding="utf-8") -setuptools.setup( +setup( name=pypi_config["package_name"], summary="CloudEvents SDK Python", long_description_content_type="text/markdown", @@ -39,6 +39,6 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", ], - packages=["cloudevents"], + packages=find_packages(exclude=["cloudevents.tests"]), version=pypi_config["version_target"], ) From fc5ac2fba1b43833f79a262ff04911f5b60f9426 Mon Sep 17 00:00:00 2001 From: Curtis Mason Date: Mon, 10 Aug 2020 17:15:01 -0700 Subject: [PATCH 13/13] removed old release_doc Signed-off-by: Curtis Mason --- RELEASING.md | 2 +- release_doc.md | 63 -------------------------------------------------- 2 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 release_doc.md diff --git a/RELEASING.md b/RELEASING.md index 140323ea..52418bad 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -17,7 +17,7 @@ push to master without updating `__version__` in After a version update is merged, the script [pypi_packaging.py](pypi_packaging.py) will create a GitHub tag for the new cloudevents version using `__version__`. The script fails if `__version__` and the local pypi version for -cloudevents are out of sync. For this reason, (pypi-release.yml)(.github/workflows/pypi-release.yml) +cloudevents are out of sync. For this reason, [pypi-release.yml](.github/workflows/pypi-release.yml) first must upload the new cloudevents pypi package, and then download the recently updated pypi cloudevents package for [pypi_packaging.py](pypi_packaging.py) not to fail. diff --git a/release_doc.md b/release_doc.md deleted file mode 100644 index 46980ba2..00000000 --- a/release_doc.md +++ /dev/null @@ -1,63 +0,0 @@ -# Release process - -## Run tests on target branch - -Steps: - - tox - -## Cut off stable branch - -Steps: - - git checkout -b vX.X.X-stable - - -## Create GitHub tag - -Steps: - - git tag -a X.X.X -m "X.X.X" - - -## Build distribution package - -Steps: - - rm -rf dist - pip install -U setuptools wheel - python setup.py sdist bdist_wheel - - -## Check install capability for the wheel - -Steps: - - python3.7 -m venv .test_venv - source .test_venv/bin/activate - pip install dist/cloudevents-X.X.X-py3-none-any.whl - - -## Submit release to PyPI - -Steps: - - pip install -U twine - twine upload dist/* - - -## Push the release to GitHub - -Steps: - - git push origin vX.X.X-stable - git push --tags - - -## Verify install capability for the wheel - -Steps: - - python3.7 -m venv .test_venv - source .new_venv/bin/activate - pip install cloudevents --upgrade