Skip to content

Commit 174aff0

Browse files
authored
Merge branch 'master' into fix-threading
2 parents e9bce37 + b6c2cc4 commit 174aff0

File tree

10 files changed

+78
-15
lines changed

10 files changed

+78
-15
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
10+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
1111

1212
steps:
1313
- uses: actions/checkout@v2

.github/workflows/pypi.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
name: Publish Python package
22

33
on:
4-
push:
5-
tags:
4+
push:
5+
branches:
6+
- main
7+
- master
68

79
jobs:
810
publish:
911
name: Build and publish python packages
1012
runs-on: ubuntu-18.04
13+
1114
steps:
1215
- uses: actions/checkout@v2
1316

17+
- name: get release info
18+
id: release_info
19+
run: |
20+
version="$(awk '/^## / { print tolower($2) }' CHANGELOG.md | head -1)"
21+
echo "::set-output name=version::$version"
22+
1423
- name: Set up Python 3.7
1524
uses: actions/setup-python@v2
1625
with:
@@ -40,7 +49,7 @@ jobs:
4049
python setup.py sdist bdist_wheel
4150
4251
- name: Publish distribution to PyPI
43-
if: startsWith(github.ref, 'refs/tags')
52+
if: steps.release_info.outputs.version != 'unreleased'
4453
uses: pypa/gh-action-pypi-publish@master
4554
with:
4655
password: ${{ secrets.pypi_password }}

.github/workflows/release.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: get release info
19+
id: release_info
20+
run: |
21+
version="$(awk '/^## / { print tolower($2) }' CHANGELOG.md | head -1)"
22+
changelog="$(sed -e "1,/^## ${version}/d" -e "/^## /,\$d" CHANGELOG.md)"
23+
changelog="${changelog//'%'/'%25'}"
24+
changelog="${changelog//$'\n'/'%0A'}"
25+
changelog="${changelog//$'\r'/'%0D'}"
26+
echo "::set-output name=version::$version"
27+
echo "::set-output name=changelog::$changelog"
28+
29+
- name: create release
30+
if: steps.release_info.outputs.version != 'unreleased'
31+
uses: actions/create-release@v1
32+
id: create_release
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
tag_name: ${{ steps.release_info.outputs.version }}
37+
release_name: Release ${{ steps.release_info.outputs.version }}
38+
body: ${{ steps.release_info.outputs.changelog }}

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## unreleased
8+
9+
### Changed
10+
- updated all of the requirements to latest versions
11+
- updated github actions to automatically create releases
12+
13+
## 2.4.0 - 2021-02-22
14+
15+
### Changed
16+
- clowder is no longer the default exchange. Exchanges are no longer used and
17+
this is deprecated.
18+
- fix check for thread is_alive, fixes warning in python 3.9
19+
20+
### Removed
21+
- Removed the extractors.<queue_name> since it was not used.
22+
723
## 2.3.4 - 2020-10-04
824

925
### Fixed

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
# built documents.
5858
#
5959
# The short X.Y version.
60-
version = u'2.1'
60+
version = u'2.4'
6161
# The full version, including alpha/beta/rc tags.
62-
release = u'2.1.1'
62+
release = u'2.4.0'
6363

6464
# The language for content autogenerated by Sphinx. Refer to documentation
6565
# for a list of supported languages.

pyclowder/connectors.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,6 @@ def connect(self):
661661

662662
# declare the queue in case it does not exist
663663
self.channel.queue_declare(queue=self.rabbitmq_queue, durable=True)
664-
self.channel.queue_declare(queue='extractors.' + self.rabbitmq_queue, durable=True)
665664
self.channel.queue_declare(queue='error.'+self.rabbitmq_queue, durable=True)
666665

667666
# register with an exchange
@@ -884,7 +883,7 @@ def start_thread(self, json_body):
884883

885884
def is_finished(self):
886885
with self.lock:
887-
return self.thread and not self.thread.isAlive() and self.finished and len(self.messages) == 0
886+
return self.thread and not self.thread.is_alive() and self.finished and len(self.messages) == 0
888887

889888
def process_messages(self, channel, rabbitmq_queue):
890889
while self.messages:

pyclowder/extractors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __init__(self):
6363
if not rabbitmq_queuename:
6464
rabbitmq_queuename = self.extractor_info['name']
6565
rabbitmq_uri = os.getenv('RABBITMQ_URI', "amqp://guest:[email protected]/%2f")
66-
rabbitmq_exchange = os.getenv('RABBITMQ_EXCHANGE', "clowder")
66+
rabbitmq_exchange = os.getenv('RABBITMQ_EXCHANGE', "")
6767
clowder_url = os.getenv("CLOWDER_URL", "")
6868
registration_endpoints = os.getenv('REGISTRATION_ENDPOINTS', "")
6969
logging_config = os.getenv("LOGGING")
@@ -143,7 +143,7 @@ def start(self):
143143
for key, value in self.extractor_info['process'].items():
144144
for mt in value:
145145
# Replace trailing '*' with '#'
146-
mt = re.sub('(\*$)', '#', mt)
146+
mt = re.sub(r'(\*$)', '#', mt)
147147
if mt.find('*') > -1:
148148
logger.error("Invalid '*' found in rabbitmq_key: %s" % mt)
149149
else:

pyclowder/files.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def download(connector, host, key, fileid, intermediatefileid=None, ext=""):
4747
result = connector.get(url, stream=True, verify=connector.ssl_verify if connector else True)
4848

4949
(inputfile, inputfilename) = tempfile.mkstemp(suffix=ext)
50+
5051
try:
5152
with os.fdopen(inputfile, "wb") as outputfile:
5253
for chunk in result.iter_content(chunk_size=10*1024):

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
enum34==1.1.6
2-
pika==1.1.0
3-
PyYAML==5.1
4-
requests==2.24.0
1+
enum34==1.1.10
2+
pika==1.2.0
3+
PyYAML==5.4.1
4+
requests==2.26.0
55
requests-toolbelt==0.9.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def description():
99

1010

1111
setup(name='pyclowder',
12-
version='2.3.4',
12+
version='2.4.0',
1313
packages=find_packages(),
1414
description='Python SDK for the Clowder Data Management System',
1515
long_description=description(),

0 commit comments

Comments
 (0)