Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for python 3.11 #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:stitch-tap-tester
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:stitch-tap-tester-3-11-dev
steps:
- checkout
- run:
Expand All @@ -22,14 +22,13 @@ jobs:
command: |
source /usr/local/share/virtualenvs/tap-quickbooks/bin/activate
# TODO: Adjust the pylint disables
pylint tap_quickbooks --disable 'broad-except,chained-comparison,empty-docstring,fixme,invalid-name,line-too-long,missing-class-docstring,missing-function-docstring,missing-module-docstring,no-else-raise,no-else-return,too-few-public-methods,too-many-arguments,too-many-branches,too-many-lines,too-many-locals,ungrouped-imports,wrong-spelling-in-comment,wrong-spelling-in-docstring,bad-whitespace,undefined-loop-variable,too-many-instance-attributes'
pylint tap_quickbooks --disable 'broad-except,chained-comparison,empty-docstring,fixme,invalid-name,line-too-long,missing-class-docstring,missing-function-docstring,missing-module-docstring,no-else-raise,no-else-return,too-few-public-methods,too-many-arguments,too-many-branches,too-many-lines,too-many-locals,ungrouped-imports,wrong-spelling-in-comment,wrong-spelling-in-docstring,undefined-loop-variable,too-many-instance-attributes,consider-using-f-string,missing-class-docstring,broad-exception-raised,use-dict-literal'
- run:
name: 'Unit Tests'
command: |
source /usr/local/share/virtualenvs/tap-quickbooks/bin/activate
pip install nose coverage parameterized
nosetests --with-coverage --cover-erase --cover-package=tap_quickbooks --cover-html-dir=htmlcov tests/unittests
coverage html
pip install nose2 parameterized nose2[coverage_plugin]>=0.6.5
nose2 --with-coverage -v -s tests/unittests
- store_test_results:
path: test_output/report.xml
- store_artifacts:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 2.2.0

* Updates to run on python 3.11.7 [#69](https://github.com/singer-io/tap-quickbooks/pull/69)

## 2.1.0

* Add support for dev mode [#64](https://github.com/singer-io/tap-quickbooks/pull/64)
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
from setuptools import setup

setup(name='tap-quickbooks',
version='2.1.0',
version='2.2.0',
description='Singer.io tap for extracting data from the Quickbooks API',
author='Stitch',
url='http://singer.io',
classifiers=['Programming Language :: Python :: 3 :: Only'],
py_modules=['tap_quickbooks'],
install_requires=[
'singer-python==5.13.0',
'requests==2.23.0',
'singer-python==6.0.0',
'requests==2.31.0',
'requests_oauthlib==1.3.0',
],
extras_require={
'test': [
'pylint==2.5.3',
'nose'
'pylint==3.0.3',
'nose2'
],
'dev': [
'ipdb'
Expand Down
4 changes: 2 additions & 2 deletions tap_quickbooks/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ def _write_config(self, token):
LOGGER.info("Credentials Refreshed")

# Update config at config_path
with open(self.config_path) as file:
with open(self.config_path, encoding='UTF-8') as file:
config = json.load(file)

config['refresh_token'] = token['refresh_token']
config['access_token'] = token['access_token']
with open(self.config_path, 'w') as file:
with open(self.config_path, 'w', encoding='UTF-8') as file:
json.dump(config, file, indent=2)

@backoff.on_exception(backoff.expo, Timeout, max_tries=5, factor=2)
Expand Down
4 changes: 2 additions & 2 deletions tap_quickbooks/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _load_schemas():
for filename in files:
path = _get_abs_path("schemas") + "/" + filename
file_raw = filename.replace(".json", "")
with open(path) as file:
with open(path, encoding='UTF-8') as file:
try:
schemas[file_raw] = json.load(file)
except:
Expand All @@ -42,7 +42,7 @@ def _load_shared_schema_refs():

shared_schema_refs = {}
for shared_file in shared_file_names:
with open(os.path.join(shared_schemas_path, shared_file)) as data_file:
with open(os.path.join(shared_schemas_path, shared_file), encoding='UTF-8') as data_file:
shared_schema_refs['shared/' + shared_file] = json.load(data_file)

return shared_schema_refs
Expand Down
5 changes: 2 additions & 3 deletions tap_quickbooks/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from singer import utils
from singer.utils import strptime_to_utc

import tap_quickbooks.query_builder as query_builder
from tap_quickbooks import query_builder

DATE_WINDOW_SIZE = 29

Expand Down Expand Up @@ -272,8 +272,7 @@ def sync(self):
start_dttm = end_dttm + timedelta(days=1) # one record is emitted for every day so start from next day
end_dttm = start_dttm + timedelta(days=DATE_WINDOW_SIZE)

if end_dttm > now_dttm:
end_dttm = now_dttm
end_dttm = min(end_dttm, now_dttm)

singer.write_state(self.state)

Expand Down