Skip to content

Commit

Permalink
Merge pull request #12 from micktwomey/go-1.0.0
Browse files Browse the repository at this point in the history
Release 1.0.0-alpha.0
  • Loading branch information
micktwomey authored Jul 15, 2021
2 parents c4fbb40 + f689455 commit 85b3ffd
Show file tree
Hide file tree
Showing 20 changed files with 1,288 additions and 384 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_size = 4
indent_style = space
end_of_line = lf
trim_trailing_whitespace = true
charset = utf-8
insert_final_newline = true

[{*.yaml,*.yml}]
indent_size = 2
19 changes: 19 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#shellcheck shell=bash

layout_poetry() {
if [[ ! -f pyproject.toml ]]; then
log_error 'No pyproject.toml found. Use "poetry new" or "poetry init" to create one first.'
exit 2
fi

local PYTHON
PYTHON=$(poetry run which python)
local VENV
VENV=$(dirname "${PYTHON}")
VIRTUAL_ENV=$(echo "$VENV" | rev | cut -d'/' -f2- | rev)
export VIRTUAL_ENV
export POETRY_ACTIVE=1
PATH_add "$VENV"
}

layout poetry
71 changes: 23 additions & 48 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,42 @@
# Build a matrix of versions using tox support from https://github.com/ymyzk/tox-gh-actions
name: Python build

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 8
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, pypy2, pypy3]
python-version: [3.6, 3.7, 3.8, 3.9]
# python-version: [3.6, 3.7, 3.8, 3.9, pypy3]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Update pip
run: python -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Load pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install tox tox-gh-actions
- name: Test with tox
run: tox
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install nox
run: python -m pip install --upgrade nox
- name: nox test
run: nox --python ${{ matrix.python-version }} --session test

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Update pip
run: python -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Load pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install -r dev-requirements.txt
- name: Lint with mypy
run: mypy --ignore-missing-imports -p iso8601
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install nox
run: python -m pip install --upgrade nox
- name: nox lint
run: nox --session lint
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
__pycache__
build
dist
.vscode
.hypothesis
10 changes: 0 additions & 10 deletions .hgignore

This file was deleted.

8 changes: 0 additions & 8 deletions .hgtags

This file was deleted.

23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# To update: run `pre-commit autoupdate`
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.9.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 21.6b0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
hooks:
- id: mypy
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python 3.8.5 2.7.18 3.7.9 3.6.12 3.5.9
python 3.9.6 3.10.0b3 3.8.7 3.7.9 3.6.12
36 changes: 22 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Simple module to parse ISO 8601 dates

This module parses the most common forms of ISO 8601 date strings (e.g.
2007-01-14T20:34:22+00:00) into datetime objects.
This module parses the most common forms of ISO 8601 date strings (e.g. 2007-01-14T20:34:22+00:00) into datetime objects.

>>> import iso8601
>>> iso8601.parse_date("2007-01-25T12:00:00Z")
Expand All @@ -12,7 +11,10 @@ See the LICENSE file for the license this package is released under.

If you want more full featured parsing look at:

- https://arrow.readthedocs.io - arrow
- https://pendulum.eustace.io - pendulum
- https://labix.org/python-dateutil - python-dateutil
- https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat - Yes, Python 3 has built in parsing too!

Parsed Formats
==============
Expand Down Expand Up @@ -72,38 +74,44 @@ References
Testing
=======

1. pip install -r dev-requirements.txt
2. tox
1. poetry install
2. poetry run nox

Note that you need all the pythons installed to perform a tox run (see below). pyenv helps hugely, use pyenv install for the versions you need then use 'pyenv local version ...' to link them in (the tox-pyenv plugin will pick them up).

Alternatively, to test only with your current python:

1. pip install -r dev-requirements.txt
2. py.test --verbose iso8601
1. poetry install
2. pytest

Supported Python Versions
=========================

Tested against:

- Python 2.7
- Python 3.5
- Python 3.6
- Python 3.7
- Python 3.8
- PyPy
- Python 3.9
- Python 3.10 (pre-release)
- PyPy 3

Python 3.0, 3.1 and 3.2 are untested but should work (tests didn't run under them when last tried).

Jython is untested but should work (tests failed to run).

Python 2.5 is not supported (too old for the tests for the most part). It could work with some small changes but I'm not supporting it.
Python 3 versions < 3.6 are untested but should work.

Changes
=======

Unreleased 1.0.0
----------------

* Drop python < 3.6 support
* Add type annotations to code
* Remove external type annotations in pyi
* Switch to poetry for packaging
* Simplify internals and remove old compatability code
* Switch to nox for testing
* Lots of small project development changes

0.1.14
------

Expand Down
8 changes: 0 additions & 8 deletions dev-requirements.txt

This file was deleted.

11 changes: 7 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ This module parses the most common forms of ISO 8601 date strings (e.g. 2007-01-
datetime.datetime(2007, 1, 25, 12, 0, tzinfo=<iso8601.Utc>)
>>>

This module is released under a MIT license.
See the LICENSE file for the license this package is released under.

If you want more full featured parsing look at:

- http://labix.org/python-dateutil - python-dateutil
- https://arrow.readthedocs.io - arrow
- https://pendulum.eustace.io - pendulum
- https://labix.org/python-dateutil - python-dateutil
- https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat - Yes, Python 3 has built in parsing too!

Parsed Formats
==============
Expand All @@ -39,7 +42,7 @@ Times
Time Zones
----------

- Nothing uses the default timezone given (UTC).
- Nothing, will use the default timezone given (which in turn defaults to UTC).
- Z (UTC)
- +/-hh:mm
- +/-hhmm
Expand Down Expand Up @@ -72,7 +75,7 @@ API
Authors
=======

Currently active committers:
Currently active or previously active committers:

- Michael Twomey
- Julien Danjou
1 change: 0 additions & 1 deletion iso8601/__init__.pyi

This file was deleted.

Loading

0 comments on commit 85b3ffd

Please sign in to comment.