Skip to content

Commit

Permalink
Merge branch 'deprecate_py2'
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiz committed Sep 27, 2023
2 parents 17a0895 + 1f9f721 commit d39dc55
Show file tree
Hide file tree
Showing 19 changed files with 2,640 additions and 2,330 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
push:
branches-ignore:
- main
jobs:
build:
name: Lint & Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install tools
run: |
python -m pip install . '.[dev]'
- name: Lint with ruff
run: |
ruff src
- name: Check format with black
run: |
black --check src
- name: Run tests
run: |
python -m unittest discover
6 changes: 2 additions & 4 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
on:
pull_request: {}
push:
branches:
branches-ignore:
- main
- master
name: Semgrep
jobs:
semgrep:
name: Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: returntocorp/semgrep-action@v1
with:
auditOn: push
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dist/
*.pyc
*.egg-info/
.coverage
.ruff_cache/
4 changes: 0 additions & 4 deletions .pylintrc

This file was deleted.

17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
.PHONY: lint test coverage build clean upload all

lint:
pylint gkeepapi
-ruff --fix src
black src

test:
python3 -m unittest discover

coverage:
coverage run --source gkeepapi -m unittest discover
coverage run --source src -m unittest discover
coverage report
coverage html

build: gkeepapi/*.py
python3 setup.py bdist_wheel --universal
build: src/gkeepapi/*.py
python3 -m build

clean:
rm -f dist/*.whl
rm -rf build dist

upload:
twine upload dist/*.whl

all: build upload
all: lint test build upload
6 changes: 3 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXBUILD = python3 -msphinx
SPHINXPROJ = gkeepapi
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
77 changes: 38 additions & 39 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

sys.path.insert(0, os.path.abspath(".."))
import gkeepapi


Expand All @@ -31,28 +32,30 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.coverage',
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx.ext.githubpages']
extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.coverage",
# "sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.githubpages",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'gkeepapi'
copyright = u'2017, Kai'
author = u'Kai'
project = "gkeepapi"
copyright = "2017, Kai"
author = "Kai"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -68,15 +71,15 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -87,7 +90,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "alabaster"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -98,28 +101,28 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = []

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
"**": [
"about.html",
"navigation.html",
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
"donate.html",
]
}


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'gkeepapidoc'
htmlhelp_basename = "gkeepapidoc"


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -128,15 +131,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -146,19 +146,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'gkeepapi.tex', u'gkeepapi Documentation',
u'Kai', 'manual'),
(master_doc, "gkeepapi.tex", "gkeepapi Documentation", "Kai", "manual"),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'gkeepapi', u'gkeepapi Documentation',
[author], 1)
]
man_pages = [(master_doc, "gkeepapi", "gkeepapi Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
Expand All @@ -167,10 +163,13 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'gkeepapi', u'gkeepapi Documentation',
author, 'gkeepapi', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"gkeepapi",
"gkeepapi Documentation",
author,
"gkeepapi",
"One line description of project.",
"Miscellaneous",
),
]



9 changes: 4 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,14 @@ FAQ
This usually occurs when Google thinks the login request looks suspicious. Here are some steps you can take to resolve this:

1. Make sure you have the newest version of gkeepapi installed.
2. Instead of logging in every time, cache the authentication token and reuse it on subsequent runs. See `here <https://github.com/kiwiz/keep-cli/blob/master/keep#L106-L128>`_ for an example implementation.
2. Instead of logging in every time, cache the authentication token and reuse it on subsequent runs. See `here <https://github.com/kiwiz/keep-cli/blob/master/src/keep_cli/__main__.py#L106-L128>`__ for an example implementation.
3. If you have 2-Step Verification turned on, generating an App Password for gkeepapi is highly recommended.
4. Allowing access through this `link <https://accounts.google.com/DisplayUnlockCaptcha>`_ has worked for some people.
5. Upgrading to a newer version of Python (3.7+) has worked for some people. See this `issue <https://gitlab.com/AuroraOSS/AuroraStore/issues/217#note_249390026>`_ for more information.
6. If all else fails, try testing gkeepapi on a separate IP address and/or user to see if you can isolate the problem.
4. Upgrading to a newer version of Python (3.7+) has worked for some people. See this `issue <https://gitlab.com/AuroraOSS/AuroraStore/issues/217#note_249390026>`__ for more information.
5. If all else fails, try testing gkeepapi on a separate IP address and/or user to see if you can isolate the problem.

2. I get a "DeviceManagementRequiredOrSyncDisabled" :py:class:`exception.LoginException` when I try to log in.

This is due to the enforcement of Android device policies on your G-Suite account. To resolve this, you can try disabling that setting `here <https://admin.google.com/AdminHome?hl=no#MobileSettings:section=advanced&flyout=security>`_.
This is due to the enforcement of Android device policies on your G-Suite account. To resolve this, you can try disabling that setting `here <https://admin.google.com/AdminHome?hl=no#MobileSettings:section=advanced&flyout=security>`__.

3. My notes take a long time to sync

Expand Down
Loading

0 comments on commit d39dc55

Please sign in to comment.