From 14d85d490f826d688fa5010e2441cd3fb7f11bc0 Mon Sep 17 00:00:00 2001 From: Kristof Daja Date: Sat, 12 Dec 2020 15:41:50 +0100 Subject: [PATCH] Configuring GitHub Workflows --- .github/workflows/publish-to-pypi.yml | 2 -- README.md | 3 ++- freeze_git_tag.py | 35 --------------------------- 3 files changed, 2 insertions(+), 38 deletions(-) delete mode 100755 freeze_git_tag.py diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 75c971a..4198d04 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -2,8 +2,6 @@ name: publish-py-dist-to-pypi on: push: - branches: - - master tags: - v** diff --git a/README.md b/README.md index c47ff14..8cf89cc 100644 --- a/README.md +++ b/README.md @@ -109,8 +109,9 @@ In case a bucket is missing or its configuration differs, it gets created and co For a reference implementation, see [Examples](examples). ## Compatibility - * Django 2.0 or later + * Django 2.2 or later * Python 3.6.0 or later + * MinIO SDK 7.0.0 or later **Note:** This library relies heavily on [PEP 484 -- Type Hints](https://www.python.org/dev/peps/pep-0484/) which was introduced in *Python 3.5.0*. diff --git a/freeze_git_tag.py b/freeze_git_tag.py deleted file mode 100755 index e4d5dec..0000000 --- a/freeze_git_tag.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python3 -import re -import sys -import signal -import subprocess - - -def signal_handler(_, __): - print('\n----------------------------------------------') - print('Exiting. No tag will be written to setup.py') - sys.exit(0) - - -if __name__ == '__main__': - signal.signal(signal.SIGINT, signal_handler) - - git_tag = subprocess.check_output(['git', 'describe', '--tags']).strip().decode('utf-8') - pattern = re.compile(r"CURRENT_GIT_TAG = '(v[1-9.]+)'") - - if '--skip-confirm' not in sys.argv: - print('----------------------------------------------') - print(f'Tag {git_tag} will be written to setup.py') - input('Press ENTER to continue or Ctrl+C to stop...') - print('----------------------------------------------') - - with open('setup.py', 'r+') as f: - old_contents = f.read() - try: - f.seek(0) - new_contents = re.sub(pattern, f"CURRENT_GIT_TAG = '{git_tag}'", old_contents) - f.write(new_contents) - f.truncate() - print(f'Tag {git_tag} has been written to setup.py') - except (OSError, ValueError): - f.write(old_contents)