From 119bb6730c87f3c95e4ebf6355ba817f58c71ee2 Mon Sep 17 00:00:00 2001 From: Jad Chaar Date: Sun, 16 May 2021 17:31:09 -0400 Subject: [PATCH] Change requirements.txt to requirements-dev.txt and clean up dependency versioning. (#978) --- .github/workflows/continuous_integration.yml | 12 ++++++------ .pre-commit-config.yaml | 6 +++--- MANIFEST.in | 2 +- Makefile | 4 ++-- requirements-dev.txt | 10 ++++++++++ requirements.txt | 10 ---------- setup.cfg | 6 +----- setup.py | 10 +++++----- tox.ini | 2 +- 9 files changed, 29 insertions(+), 33 deletions(-) create mode 100644 requirements-dev.txt delete mode 100644 requirements.txt diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 350bbb4f5..c3de5ffea 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -33,7 +33,7 @@ jobs: if: startsWith(runner.os, 'Linux') with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} restore-keys: | ${{ runner.os }}-pip- @@ -42,7 +42,7 @@ jobs: if: startsWith(runner.os, 'macOS') with: path: ~/Library/Caches/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} restore-keys: | ${{ runner.os }}-pip- @@ -51,7 +51,7 @@ jobs: if: startsWith(runner.os, 'Windows') with: path: ~\AppData\Local\pip\Cache - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} restore-keys: | ${{ runner.os }}-pip- @@ -85,17 +85,17 @@ jobs: - uses: actions/checkout@v2 # Set up Python - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: - python-version: "3.8" + python-version: "3.9" # Configure pip cache - name: Cache pip uses: actions/cache@v2 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} restore-keys: | ${{ runner.os }}-pip- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b2494fb9a..9980187d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.0.1 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -20,7 +20,7 @@ repos: hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v2.15.0 + rev: v2.16.0 hooks: - id: pyupgrade args: [--py36-plus] @@ -34,7 +34,7 @@ repos: - id: rst-directive-colons - id: rst-inline-touching-normal - repo: https://github.com/psf/black - rev: 21.5b0 + rev: 21.5b1 hooks: - id: black args: [--safe, --quiet, --target-version=py36] diff --git a/MANIFEST.in b/MANIFEST.in index d9955ed96..8ac191e0e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ -include LICENSE CHANGELOG.rst README.rst Makefile requirements.txt tox.ini +include LICENSE CHANGELOG.rst README.rst Makefile requirements-dev.txt tox.ini recursive-include tests *.py recursive-include docs *.py *.rst *.bat Makefile diff --git a/Makefile b/Makefile index 18a7fbc5e..efdcb2d7b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: auto test docs clean -auto: build38 +auto: build39 build36: PYTHON_VER = python3.6 build37: PYTHON_VER = python3.7 @@ -11,7 +11,7 @@ build36 build37 build38 build39: clean $(PYTHON_VER) -m venv venv . venv/bin/activate; \ pip install -U pip setuptools wheel; \ - pip install -r requirements.txt; \ + pip install -r requirements-dev.txt; \ pre-commit install test: diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 000000000..2035ec243 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,10 @@ +dateparser==1.* +pre-commit==2.* +pytest==6.* +pytest-cov==2.* +pytest-mock==3.* +python-dateutil==2.* +pytz==2019.* +simplejson==3.* +sphinx==4.* +sphinx-autodoc-typehints==1.* diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6e7dffdf5..000000000 --- a/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -dateparser==1.0.* -pre-commit==2.12.* -pytest==6.2.* -pytest-cov==2.11.* -pytest-mock==3.6.* -python-dateutil==2.8.* -pytz==2019.* -simplejson==3.17.* -sphinx==4.0.* -sphinx-autodoc-typehints==1.12.* diff --git a/setup.cfg b/setup.cfg index bfb63588d..3add2419c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,12 +23,8 @@ warn_unreachable = True strict_equality = True no_implicit_reexport = True -## - allow_redefinition = True - -# Type annotation for test codes and migration files are not mandatory - +# Type annotations for testing code and migration files are not mandatory [mypy-*.tests.*,tests.*] ignore_errors = True diff --git a/setup.py b/setup.py index 14dff60db..df0a5a759 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,12 @@ # mypy: ignore-errors -from setuptools import setup +from pathlib import Path -with open("README.rst", encoding="utf-8") as f: - readme = f.read() +from setuptools import setup +readme = Path("README.rst").read_text(encoding="utf-8") +version = Path("arrow/_version.py").read_text(encoding="utf-8") about = {} -with open("arrow/_version.py", encoding="utf-8") as f: - exec(f.read(), about) +exec(version, about) setup( name="arrow", diff --git a/tox.ini b/tox.ini index a1ebbc93b..7113f0d95 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ python = 3.9: py39 [testenv] -deps = -rrequirements.txt +deps = -rrequirements-dev.txt allowlist_externals = pytest commands = pytest