Skip to content

Commit

Permalink
ci: only run linting in pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenmannmartin committed Oct 11, 2021
1 parent ffeef91 commit ff17a9e
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 87 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ jobs:
python -m pip install --upgrade pip
pip install pipenv==v2021.5.29
pipenv install --dev --deploy
- name: Lint with black and flake
run: |
pipenv run black --check icalevents
pipenv run flake8 . --count --exit-zero
- name: Test with pytest
run: |
pipenv run coverage run test.py
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ repos:
rev: 21.9b0
hooks:
- id: black
args: ['--check', 'icalevents']
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
Expand Down
25 changes: 12 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,49 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

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


# -- Project information -----------------------------------------------------

project = 'iCalEvents'
copyright = '2021, Thomas Irgang'
author = 'Thomas Irgang'
project = "iCalEvents"
copyright = "2021, Thomas Irgang"
author = "Thomas Irgang"

# The full version, including alpha/beta/rc tags
release = '0.1.25'
release = "0.1.25"


# -- General configuration ---------------------------------------------------

# 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.autodoc'
]
extensions = ["sphinx.ext.autodoc"]

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

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


# -- Options for HTML output -------------------------------------------------

# 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"

html_theme_options = {
# Disable showing the sidebar. Defaults to 'false'
'nosidebar': True,
"nosidebar": True,
}

# 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 = ["_static"]
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from icalevents.icalevents import events_async, latest_events, all_done
from time import sleep

if __name__ == '__main__':
if __name__ == "__main__":
keys = []

with open('calendars.txt', mode='r', encoding='utf-8') as f:
with open("calendars.txt", mode="r", encoding="utf-8") as f:
counter = 1

while True:
Expand All @@ -17,7 +17,7 @@
url = url.strip()

fix_apple = False
if name == 'icloud':
if name == "icloud":
fix_apple = True

key = "req_%d" % counter
Expand Down
52 changes: 27 additions & 25 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
#!/usr/bin/env python3
from setuptools import setup

version = '0.1.25'
version = "0.1.25"

setup(
name = 'icalevents',
packages = ['icalevents'],
name="icalevents",
packages=["icalevents"],
install_requires=[
"httplib2",
"icalendar",
"pytz",
"datetime",
],
version=version,
description = 'iCal downloader and parser',
author = 'Thomas Irgang',
author_email = '[email protected]',
url = 'https://github.com/jazzband/icalevents',
download_url = 'https://github.com/jazzband/icalevents/archive/v' + version + '.tar.gz',
keywords = ['iCal'],
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Development Status :: 4 - Beta',
'Environment :: Other Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Operating System :: OS Independent',
'Topic :: Software Development :: Libraries :: Python Modules',
],
long_description = """\
description="iCal downloader and parser",
author="Thomas Irgang",
author_email="[email protected]",
url="https://github.com/jazzband/icalevents",
download_url="https://github.com/jazzband/icalevents/archive/v"
+ version
+ ".tar.gz",
keywords=["iCal"],
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Development Status :: 4 - Beta",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
],
long_description="""\
iCal download, parse and query tool
-------------------------------------
Expand All @@ -44,5 +46,5 @@
This version requires Python 3 or later.
"""
""",
)
9 changes: 5 additions & 4 deletions test/test_icaldownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class ICalDownloadTests(unittest.TestCase):

def test_apple_data_fix(self):
data = """
DTSTART:18831118T120702
Expand Down Expand Up @@ -50,7 +49,7 @@ def test_data_from_file_google(self):

expected = None

with open(result, mode='r', encoding='utf-8') as f:
with open(result, mode="r", encoding="utf-8") as f:
expected = f.read()

content = icalevents.icaldownload.ICalDownload().data_from_file(file)
Expand All @@ -63,10 +62,12 @@ def test_data_from_file_apple(self):

expected = None

with open(result, mode='r', encoding='utf-8') as f:
with open(result, mode="r", encoding="utf-8") as f:
expected = f.read()

content = icalevents.icaldownload.ICalDownload().data_from_file(file, apple_fix=True)
content = icalevents.icaldownload.ICalDownload().data_from_file(
file, apple_fix=True
)

self.assertEqual(expected, content, "content form iCal file, google format")

Expand Down
Loading

0 comments on commit ff17a9e

Please sign in to comment.