Skip to content

Commit

Permalink
Support python 3.6 (#19)
Browse files Browse the repository at this point in the history
* Support python 3.6

* Remove test dependency on 3.7 datetime

* Fix black

* Do not ignore images
  • Loading branch information
sweatybridge authored Apr 8, 2021
1 parent ff8d87c commit ca840ae
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
34 changes: 30 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@ on:
push:
branches:
- master
tags:
- "[0-9]+.[0-9]+.[0-9]+"
pull_request:
types: [opened, ready_for_review, reopened, synchronize]
paths-ignore:
- docs
- examples
- notebooks

jobs:
PR:
coverage:
runs-on: ubuntu-latest
# if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: "3.7"
python-version: 3.6
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
Expand All @@ -28,3 +33,24 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
release:
runs-on: ubuntu-latest
# Only push the image on new tag event
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install pypa/build
run: pip install build
- name: Build a binary wheel and a source tarball
run: build --sdist --wheel --outdir dist/ .
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
],
python_requires=">=3.7",
python_requires=">=3.6",
# TODO: can we relax these requirements at all?
install_requires=[
"fluent-logger==0.9.6",
"prometheus_client==0.9",
"numpy==1.19.4",
"dataclasses; python_version<'3.7'",
],
)
4 changes: 1 addition & 3 deletions tests/test_serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ def test_log_prediction():
# Validate prediction id
server_id, timestamp, entity_id = pid.split("/")
assert server_id == "unknown-server"
parsed = datetime.fromisoformat(timestamp)
assert parsed.microsecond == 0
assert not parsed.tzinfo
datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S")
assert str(UUID(entity_id)) == entity_id

body, _ = service.export_http()
Expand Down

0 comments on commit ca840ae

Please sign in to comment.