Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 1014/all-granularity
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkKoz committed Oct 2, 2023
2 parents 804eece + 87a1a77 commit 71d5233
Show file tree
Hide file tree
Showing 34 changed files with 2,292 additions and 1,346 deletions.
105 changes: 31 additions & 74 deletions .github/workflows/continuous_integration.yml
Expand Up @@ -9,115 +9,72 @@ on:
- cron: "0 0 1 * *"

jobs:
test:
unit-tests:
name: ${{ matrix.os }} (${{ matrix.python-version }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
python-version: ["pypy-3.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["pypy-3.9", "3.8", "3.9", "3.10", "3.11", "3.12-dev"]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
# pypy3 randomly fails on Windows builds
- os: windows-latest
python-version: "pypy-3.7"

python-version: "pypy-3.9"
include:
- os: ubuntu-latest
path: ~/.cache/pip
- os: macos-latest
path: ~/Library/Caches/pip
- os: windows-latest
path: ~\AppData\Local\pip\Cache
steps:
# Check out latest code
- uses: actions/checkout@v2

# Configure pip cache
- name: Cache pip (Linux)
uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache pip (macOS)
uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache pip (Windows)
uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
- uses: actions/checkout@v3
- name: Cache pip
uses: actions/cache@v3
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# Set up Python
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

# Install dependencies
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -U tox tox-gh-actions
# Run tests
- name: Test with tox
run: tox

# Upload coverage report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
file: coverage.xml

lint:
linting:
name: Linting
runs-on: ubuntu-latest

steps:
# Check out latest code
- uses: actions/checkout@v2

# Set up Python
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"

# Configure pip cache
- name: Cache pip
uses: actions/cache@v2
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# Configure pre-commit cache
- name: Cache pre-commit
uses: actions/cache@v2
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: ${{ runner.os }}-pip-
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-
# Install dependencies
restore-keys: ${{ runner.os }}-pre-commit-
- name: Set up Python ${{ runner.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -U tox
# Lint code
- name: Lint code
run: tox -e lint

# Lint docs
run: tox -e lint -- --show-diff-on-failure
- name: Lint docs
run: tox -e docs
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,30 @@
name: release

on:
workflow_dispatch: # run manually
push: # run on matching tags
tags:
- '*.*.*'

jobs:
release-to-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: ${{ runner.os }}-pip-
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -U tox
- name: Publish package to PyPI
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: tox -e publish
28 changes: 16 additions & 12 deletions .pre-commit-config.yaml
Expand Up @@ -2,49 +2,53 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: fix-encoding-pragma
args: [--remove]
- id: requirements-txt-fixer
- id: check-ast
- id: check-yaml
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-builtin-literals
- id: debug-statements
- id: end-of-file-fixer
- id: fix-encoding-pragma
args: [--remove]
- id: requirements-txt-fixer
args: [requirements/requirements.txt, requirements/requirements-docs.txt, requirements/requirements-tests.txt]
- id: trailing-whitespace
- repo: https://github.com/timothycrosley/isort
rev: 5.9.3
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.0
rev: v3.13.0
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
rev: v1.10.0
hooks:
- id: python-no-eval
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- id: python-use-type-annotations
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- id: text-unicode-replacement-char
- repo: https://github.com/psf/black
rev: 21.9b0
rev: 23.9.1
hooks:
- id: black
args: [--safe, --quiet, --target-version=py36]
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear,flake8-annotations]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.910-1'
rev: v1.5.1
hooks:
- id: mypy
additional_dependencies: [types-python-dateutil]
29 changes: 29 additions & 0 deletions .readthedocs.yaml
@@ -0,0 +1,29 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: requirements/requirements-docs.txt
34 changes: 32 additions & 2 deletions CHANGELOG.rst
@@ -1,6 +1,36 @@
Changelog
=========

1.3.0 (2023-09-30)
------------------

- [ADDED] Added official support for Python 3.11 and 3.12.
- [ADDED] Added dependency on ``types-python-dateutil`` to improve Arrow mypy compatibility. `PR #1102 <https://github.com/arrow-py/arrow/pull/1102>`_
- [FIX] Updates to Italian, Romansh, Hungarian, Finish and Arabic locales.
- [FIX] Handling parsing of UTC prefix in timezone strings.
- [CHANGED] Update documentation to improve readability.
- [CHANGED] Dropped support for Python 3.6 and 3.7, which are end-of-life.
- [INTERNAL] Migrate from ``setup.py``/Twine to ``pyproject.toml``/Flit for packaging and distribution.
- [INTERNAL] Adopt ``.readthedocs.yaml`` configuration file for continued ReadTheDocs support.

1.2.3 (2022-06-25)
------------------

- [NEW] Added Amharic, Armenian, Georgian, Laotian and Uzbek locales.
- [FIX] Updated Danish locale and associated tests.
- [INTERNAL] Small fixes to CI.

1.2.2 (2022-01-19)
------------------

- [NEW] Added Kazakh locale.
- [FIX] The Belarusian, Bulgarian, Czech, Macedonian, Polish, Russian, Slovak and Ukrainian locales now support ``dehumanize``.
- [FIX] Minor bug fixes and improvements to ChineseCN, Indonesian, Norwegian, and Russian locales.
- [FIX] Expanded testing for multiple locales.
- [INTERNAL] Started using ``xelatex`` for pdf generation in documentation.
- [INTERNAL] Split requirements file into ``requirements.txt``, ``requirements-docs.txt`` and ``requirements-tests.txt``.
- [INTERNAL] Added ``flake8-annotations`` package for type linting in ``pre-commit``.

1.2.1 (2021-10-24)
------------------

Expand Down Expand Up @@ -267,7 +297,7 @@ After 8 years we're pleased to announce Arrow v1.0. Thanks to the entire Python
- [FIX] Consolidated and simplified German locales.
- [INTERNAL] Moved testing suite from nosetest/Chai to pytest/pytest-mock.
- [INTERNAL] Converted xunit-style setup and teardown functions in tests to pytest fixtures.
- [INTERNAL] Setup Github Actions for CI alongside Travis.
- [INTERNAL] Setup GitHub Actions for CI alongside Travis.
- [INTERNAL] Help support Arrow's future development by donating to the project on `Open Collective <https://opencollective.com/arrow>`_.

0.15.5 (2020-01-03)
Expand Down Expand Up @@ -641,7 +671,7 @@ The following will work in v0.15.0:
- [NEW] Brazilian locale (Augusto2112)
- [NEW] Dutch locale (OrangeTux)
- [NEW] Italian locale (Pertux)
- [NEW] Austrain locale (LeChewbacca)
- [NEW] Austrian locale (LeChewbacca)
- [NEW] Tagalog locale (Marksteve)
- [FIX] Corrected spelling and day numbers in German locale (LeChewbacca)
- [FIX] Factory ``get`` method should now handle unicode strings correctly (Bwells)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2021 Chris Smith
Copyright 2023 Chris Smith

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

0 comments on commit 71d5233

Please sign in to comment.