Skip to content

Commit

Permalink
Cumulus 3270 pyversion (#148)
Browse files Browse the repository at this point in the history
* boto requirement

* flag supported versions

* tests for only 3.10

* nose2

* nose2 in circle-ci

* corrected nose2 syntax

* using cimg

* virtualenv installation

* reconfig

* typo in localstack image

* trying to figure out what's up with virtualenv

* reworking virtualenv setup

* reworking virtualenv setup

* reworking virtualenv setup

* just remove venv?

* cont. reworking venv

* cont. reworking venv

* cont. reworking venv

* cont. reworking venv

* cont. reworking venv

* cont. reworking venv

* cont. reworking venv

* cont. reworking venv

* cont. reworking venv

* cont. reworking venv

* cont. reworking venv

* why doesn't this work?

* why doesn't this work?

* no cached dependencies

* restore save repo

* restore save dependencies

* restore save dependencies

* can I get this to reset the cache

* can I get this to reset the cache

* typo in cache name

* typo in cache name

* give up on dependencies cache

* cleanup unnecessary git install

* update changelog

* make sure dependencies are properly cached for deployment

* ok, build and test 38

* pyenv upgrade breaks 38

* correct 38 pyenv path

* PR review feedback from Jenny

* localstack latest

---------

Co-authored-by: ecarton <[email protected]>
  • Loading branch information
etcart and ecarton authored Jul 24, 2023
1 parent c4cd5e4 commit d622236
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 53 deletions.
79 changes: 34 additions & 45 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

version: 2
references:
container_python36: &container_python36
container_python310: &container_python310
docker:
- image: circleci/python:3.6.2
- image: cimg/python:3.10.11
- name: localstack
image: localstack/localstack
working_dir: ~/project
working_directory: ~/repo

container_python38: &container_python38
docker:
- image: circleci/python:3.8.1
- name: localstack
image: localstack/localstack
working_directory: ~/project
working_directory: ~/repo


restore_repo: &restore_repo
restore_cache:
Expand All @@ -27,85 +28,75 @@ references:
save_cache:
key: v0-repo-{{ .Branch }}-{{ .Revision }}
paths:
- ~/project

restore_dependencies36: &restore_dependencies36
restore_cache:
keys:
- v0-dependencies36-{{ checksum "requirements.txt" }}
- v0-dependencies36
- ~/repo
save_dependencies310: &save_dependencies310
save_cache:
paths:
- ~/venv310
key: v0-dependencies310-{{ checksum "requirements.txt"}}-{{ checksum "requirements-dev.txt" }}

restore_dependencies38: &restore_dependencies38
restore_dependencies310: &restore_dependencies310
restore_cache:
keys:
- v0-dependencies38-{{ checksum "requirements.txt" }}
- v0-dependencies38
- v0-dependencies310-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
- v0-dependencies310-

jobs:
install_and_test_36:
<<: *container_python36
install_and_test_38:
<<: *container_python38
steps:
- *restore_repo
- checkout
- *save_repo
- *restore_dependencies36
- run:
name: Install virtualenv
command: pip install --user virtualenv
- run:
name: Install dependencies
command: |
~/.local/bin/virtualenv ~/venv36
. ~/venv36/bin/activate
virtualenv ~/venv38
. ~/venv38/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
- save_cache:
key: v0-dependencies36-{{ checksum "requirements.txt"}}
paths:
- ~/venv36
- run :
name: Run tests
environment:
LOCALSTACK_HOST: localstack
command: |
. ~/venv36/bin/activate
nosetests -v --with-coverage --cover-package cumulus_process
. ~/venv38/bin/activate
nose2 -v --with-coverage cumulus_process
install_and_test_38:
<<: *container_python38
install_and_test_310:
<<: *container_python310
steps:
- *restore_repo
- checkout
- *save_repo
- *restore_dependencies38
- run:
name: Install virtualenv
command: pip install --user virtualenv
command: pip install --user --upgrade virtualenv
- run:
name: Install dependencies
command: |
/usr/local/bin/virtualenv ~/venv38
. ~/venv38/bin/activate
virtualenv ~/venv310
. ~/venv310/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
- save_cache:
key: v0-dependencies38-{{ checksum "requirements.txt"}}
paths:
- ~/venv38
- *save_dependencies310
- run :
name: Run tests
environment:
LOCALSTACK_HOST: localstack
command: |
. ~/venv38/bin/activate
nosetests -v --with-coverage --cover-package cumulus_process
. ~/venv310/bin/activate
nose2 -v --with-coverage cumulus_process
deploy:
<<: *container_python38
<<: *container_python310
steps:
- checkout
- *restore_repo
- *restore_dependencies38
- *restore_dependencies310
- add_ssh_keys:
fingerprints:
- "3a:8d:f7:0d:de:79:98:bc:56:10:83:ab:c1:ee:3d:30"
Expand All @@ -123,22 +114,20 @@ jobs:
- run:
name: Deploy to PyPi
command: |
. ~/venv38/bin/activate
. ~/venv310/bin/activate
pip install twine
python setup.py sdist
twine upload --skip-existing --username "${PYPI_USER}" --password "${PYPI_PASS}" dist/*
workflows:
version: 2
build_test_36:
jobs:
- install_and_test_36
build_test_38_deploy:
build_test_310_deploy:
jobs:
- install_and_test_38
- install_and_test_310
- deploy:
requires:
- install_and_test_38
- install_and_test_310
filters:
branches:
only: master
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## Unreleased

## [1.3.0] - 2023-07-13
- **CUMULUS-3270**
- Update to python 3.10
- Update boto3 to 1.26.90
- Update nosetests to nose2

## [1.2.0] - 2023-04-21

- **CUMULUS-3276**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The utilities help writing tasks that involve metadata extraction from input fil

Testing requires [localstack](https://github.com/localstack/localstack). Follow the instruction for localstack and install it on your machine then:

$ nosetests -v
$ nose2 -v

## Usage

Expand Down
2 changes: 1 addition & 1 deletion cumulus_process/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.2.0'
__version__ = '1.3.0'
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nose~=1.3.7
nose2>=0.13.0
coverage~=5.5
nose-timer~=1.0.1
testfixtures~=6.17.1
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
boto3~=1.18.40
boto3~=1.26.90
python-json-logger~=0.1
dicttoxml~=1.7.4
cumulus-message-adapter-python~=2.1.0
cumulus-message-adapter-python~=2.2.0
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.10'
],
packages=find_packages(exclude=['docs', 'tests*']),
include_package_data=True,
Expand Down

0 comments on commit d622236

Please sign in to comment.