Skip to content

Commit

Permalink
Add an __all__ to __init.py__
Browse files Browse the repository at this point in the history
Addresses #17

Add `docs/example.py` with a mypy check to catch similar issues.

Run `pre-commit autoupate`

Run `poetry update`
  • Loading branch information
micktwomey committed Nov 23, 2021
1 parent 4ddd936 commit 46baabb
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 115 deletions.
1 change: 0 additions & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [main]
pull_request:


jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 21.10b0
rev: 21.11b1
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ Python 3 versions < 3.6 are untested but should work.
Changes
=======

1.0.2
-----

* Add missing `__all__` in `__init__.py`. Addresses https://github.com/micktwomey/pyiso8601/issues/17 (thanks to Alex Gaynor for reporting)

1.0.1
-----

Expand Down
7 changes: 7 additions & 0 deletions docs/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import datetime

import iso8601

d = iso8601.parse_date("2007-01-25T12:00:00Z")
print(d)
assert d == datetime.datetime(2007, 1, 25, 12, 0, tzinfo=iso8601.UTC)
4 changes: 3 additions & 1 deletion iso8601/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from .iso8601 import *
from .iso8601 import UTC, FixedOffset, ParseError, parse_date

__all__ = ["parse_date", "ParseError", "UTC", "FixedOffset"]
12 changes: 10 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@

@nox.session(reuse_venv=True)
def lint(session: nox.Session):
session.install("pytest", "hypothesis", "pytz", "black", "mypy")
session.install("pytest", "hypothesis", "pytz", "black", "mypy", "isort")
session.run("isort", "--check", "--diff", "iso8601")
session.run("black", "--check", "--diff", "iso8601")
session.run("mypy", "iso8601")
session.run("mypy", "--strict", "iso8601")


@nox.session(reuse_venv=True)
def check_example(session: nox.Session):
session.install(".", "mypy")
session.run("mypy", "--strict", "docs/example.py")
session.run("python", "docs/example.py")


@nox.session(reuse_venv=True)
Expand Down
220 changes: 111 additions & 109 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "iso8601"
version = "1.0.1"
version = "1.0.2"
description = "Simple module to parse ISO 8601 dates"
authors = ["Michael Twomey <[email protected]>"]
license = "MIT"
Expand All @@ -27,3 +27,6 @@ Sphinx = "^4.2.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.isort]
profile = "black"

0 comments on commit 46baabb

Please sign in to comment.