From cbf73f196a227b30ffe5df874c526c9b29e61188 Mon Sep 17 00:00:00 2001 From: etcart <37375117+etcart@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:18:05 -0400 Subject: [PATCH] release 1.4.0 (#149) * release 1.4.0 * remove 3.8 * use release.sh * weird parity with cma-py * play well with twine and snyk * play well with twine and snyk --- .circleci/config.yml | 46 +------------------------------------- .snyk | 4 ++++ CHANGELOG.md | 5 +++++ Pipfile | 2 ++ bin/release.sh | 35 +++++++++++++++++++++++++++++ cumulus_process/version.py | 2 +- requirements.txt | 2 +- setup.py | 6 ----- 8 files changed, 49 insertions(+), 53 deletions(-) create mode 100644 .snyk create mode 100644 Pipfile create mode 100644 bin/release.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c5cb29..dca3c9d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,14 +9,6 @@ references: image: localstack/localstack working_directory: ~/repo - container_python38: &container_python38 - docker: - - image: circleci/python:3.8.1 - - name: localstack - image: localstack/localstack - working_directory: ~/repo - - restore_repo: &restore_repo restore_cache: keys: @@ -42,34 +34,9 @@ references: - v0-dependencies310- jobs: - install_and_test_38: - <<: *container_python38 - steps: - - *restore_repo - - checkout - - *save_repo - - run: - name: Install virtualenv - command: pip install --user virtualenv - - run: - name: Install dependencies - command: | - virtualenv ~/venv38 - . ~/venv38/bin/activate - pip install -r requirements.txt - pip install -r requirements-dev.txt - - run : - name: Run tests - environment: - LOCALSTACK_HOST: localstack - command: | - . ~/venv38/bin/activate - nose2 -v --with-coverage cumulus_process - install_and_test_310: <<: *container_python310 steps: - - *restore_repo - checkout - *save_repo - run: @@ -97,20 +64,10 @@ jobs: - checkout - *restore_repo - *restore_dependencies310 - - add_ssh_keys: - fingerprints: - - "3a:8d:f7:0d:de:79:98:bc:56:10:83:ab:c1:ee:3d:30" - run: name: Push tag to github command: | - VERSION=`awk -F\' '{print $2,$4}' cumulus_process/version.py` - - # Only tag and release if the version doesn't already exist - if [ -z $(git ls-remote --tags origin | grep $VERSION) ]; then - git tag $VERSION - echo "Pushing tag ${VERSION}" - git push origin $VERSION - fi + GITHUB_TOKEN=${GITHUB_TOKEN} sh bin/release.sh - run: name: Deploy to PyPi command: | @@ -123,7 +80,6 @@ workflows: version: 2 build_test_310_deploy: jobs: - - install_and_test_38 - install_and_test_310 - deploy: requires: diff --git a/.snyk b/.snyk new file mode 100644 index 0000000..36be7b8 --- /dev/null +++ b/.snyk @@ -0,0 +1,4 @@ +# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. +version: v1.25.0 +language-settings: + python: "3.10" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e097d9a..25ce4f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +## [1.4.0] - 2024-09-24 +- **CUMULUS-3838** + - remove support for python38 + - update to cumulus-message-adapter-python 2.3.0 + ## [1.3.0] - 2023-07-13 - **CUMULUS-3270** - Update to python 3.10 diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..53d70a0 --- /dev/null +++ b/Pipfile @@ -0,0 +1,2 @@ +[requires] +python_version = "3.10" \ No newline at end of file diff --git a/bin/release.sh b/bin/release.sh new file mode 100644 index 0000000..46d25da --- /dev/null +++ b/bin/release.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -ex +VERSION_TAG=$(awk -F\' '{print $2}' cumulus_process/version.py) +LATEST_TAG=$(curl -H \ + "Authorization: token $GITHUB_TOKEN" \ + https://api.github.com/repos/nasa/cumulus-process-py/tags | jq --raw-output '.[0].name') +git config --global user.email "cumulus.bot@gmail.com" +git config --global user.name "Cumulus Bot" +export VERSION_TAG +export LATEST_TAG + +if [ "$VERSION_TAG" != "$LATEST_TAG" ]; then + echo "tag does not exist for version $VERSION_TAG, creating tag" + + # create git tag + git tag -a "$VERSION_TAG" -m "$VERSION_TAG" || echo "$VERSION_TAG already exists" + git push origin "$VERSION_TAG" +fi + +RELEASE_URL=$(curl -H \ + "Authorization: token $GITHUB_TOKEN" \ + https://api.github.com/repos/nasa/cumulus-process-py/releases/tags/$VERSION_TAG | jq --raw-output '.url // ""') +export RELEASE_URL + +if [ -z "$RELEASE_URL" ]; then + echo "release does not exist" + + curl -H \ + "Authorization: token $GITHUB_TOKEN" \ + -d "{\"tag_name\": \"$VERSION_TAG\", \"name\": \"$VERSION_TAG\", \"body\": \"Release $VERSION_TAG\" }"\ + -H "Content-Type: application/json"\ + -X POST \ + https://api.github.com/repos/nasa/cumulus-process-py/releases +fi diff --git a/cumulus_process/version.py b/cumulus_process/version.py index 19b4f1d..96e3ce8 100644 --- a/cumulus_process/version.py +++ b/cumulus_process/version.py @@ -1 +1 @@ -__version__ = '1.3.0' +__version__ = '1.4.0' diff --git a/requirements.txt b/requirements.txt index f32b3bd..3d32bcd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ boto3~=1.26.90 python-json-logger~=0.1 dicttoxml~=1.7.4 -cumulus-message-adapter-python~=2.2.0 +cumulus-message-adapter-python~=2.3.0 diff --git a/setup.py b/setup.py index 7018688..566fb9e 100644 --- a/setup.py +++ b/setup.py @@ -24,12 +24,6 @@ url='https://github.com/nasa-cumulus/cumulus-process-py', license='Apache 2.0', classifiers=[ - 'Topic :: Software Development :: Libraries', - 'Topic :: Scientific/Engineering', - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.10' ], packages=find_packages(exclude=['docs', 'tests*']),