From 270688c441c613bd4d9f7250ea93f67ca17d45b4 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 13 May 2020 23:46:18 +0200 Subject: Travis CI: Lint Python code for syntax errors and undefined names --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..bb3ac0da --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +dist: focal +language: python +install: pip install flake8 +script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -- cgit v1.2.3 From 5a61dcb5c4f149d350c7f01421a13c620cef7f48 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 13 May 2020 23:59:52 +0200 Subject: python: 3.8 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index bb3ac0da..9b08e64a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ +os: linux dist: focal language: python +python: 3.8 install: pip install flake8 script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -- cgit v1.2.3 From 938209d5a6011066a23f3ca9f1c85beeb8b400a6 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 14 May 2020 00:06:10 +0200 Subject: Indentity is not the same this as equality in Python --- python/tests/harvest_state.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/tests/harvest_state.py b/python/tests/harvest_state.py index 85cd2c99..da9bef84 100644 --- a/python/tests/harvest_state.py +++ b/python/tests/harvest_state.py @@ -11,7 +11,7 @@ def test_harvest_state(): hs = HarvestState(catchup_days=5) assert max(hs.to_process) < today - assert len(hs.to_process) is 5 + assert len(hs.to_process) == 5 for d in list(hs.to_process): hs.complete(d) @@ -22,12 +22,12 @@ def test_harvest_state(): start_date=datetime.date(2000,1,1), end_date=datetime.date(2000,1,3), ) - assert len(hs.to_process) is 3 + assert len(hs.to_process) == 3 hs = HarvestState( start_date=datetime.date(2000,1,29), end_date=datetime.date(2000,2,2), ) - assert len(hs.to_process) is 5 + assert len(hs.to_process) == 5 hs = HarvestState(catchup_days=0) assert hs.next() is None @@ -35,6 +35,6 @@ def test_harvest_state(): start_date=datetime.date(2000,1,1), end_date=datetime.date(2000,1,3), ) - assert len(hs.to_process) is 3 + assert len(hs.to_process) == 3 hs.update('{"completed-date": "2000-01-02"}') - assert len(hs.to_process) is 2 + assert len(hs.to_process) == 2 -- cgit v1.2.3 From 00a741f9268988eb0afa62099cd404f1a1d0777f Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 14 May 2020 00:07:17 +0200 Subject: Indentity is not the same this as equality in Python --- python/fatcat_tools/importers/jalc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/fatcat_tools/importers/jalc.py b/python/fatcat_tools/importers/jalc.py index c2adc0d6..e30bb233 100644 --- a/python/fatcat_tools/importers/jalc.py +++ b/python/fatcat_tools/importers/jalc.py @@ -201,11 +201,11 @@ class JalcImporter(EntityImporter): date = record.date or None if date: date = date.string - if len(date) is 10: + if len(date) == 10: release_date = datetime.datetime.strptime(date['completed-date'], DATE_FMT).date() release_year = release_date.year release_date = release_date.isoformat() - elif len(date) is 4 and date.isdigit(): + elif len(date) == 4 and date.isdigit(): release_year = int(date) pages = None -- cgit v1.2.3 From 48bf94c8ac9491af513f666d3f7579ece525e553 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 14 May 2020 00:23:05 +0200 Subject: Delete .travis.yml --- .travis.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9b08e64a..00000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -os: linux -dist: focal -language: python -python: 3.8 -install: pip install flake8 -script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -- cgit v1.2.3 From 2e1b5b85c3b8f61ab5b0ebc55a880f0b742ca413 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 14 May 2020 09:11:25 +0200 Subject: LICENSE.md: Properly capitalize brand names --- LICENSE.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 2de9f769..5765d5b8 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -5,15 +5,15 @@ The schema files are: Copyright, 2018 Bryan Newbold