From df57e535598a34c28c884d6100eda2ca1fea6c95 Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Wed, 4 Oct 2023 16:49:59 +0100 Subject: [PATCH 1/7] Update pre-commit --- .pre-commit-config.yaml | 16 ++++++++-------- fancylog/fancylog.py | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7bc1060..e8689f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,8 @@ +exclude: 'conf.py' +# Configuring https://pre-commit.ci/ bot +ci: + autoupdate_schedule: monthly repos: - - repo: https://github.com/pycqa/isort - rev: 5.12.0 - hooks: - - id: isort - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: @@ -15,16 +15,16 @@ repos: args: [--fix=lf] - id: requirements-txt-fixer - id: trailing-whitespace - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.238 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.291 hooks: - id: ruff - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.9.1 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.991 + rev: v1.5.1 hooks: - id: mypy additional_dependencies: diff --git a/fancylog/fancylog.py b/fancylog/fancylog.py index ca9e890..e3bdf28 100644 --- a/fancylog/fancylog.py +++ b/fancylog/fancylog.py @@ -120,7 +120,6 @@ def __init__( write_variables=True, log_header=None, ): - self.file = open(file, "w", encoding="utf-8") self.program = program if write_header: From 6cdb421a45b8a5c8f820bb886acd5ba09acadd45 Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Wed, 4 Oct 2023 16:51:34 +0100 Subject: [PATCH 2/7] remove python 3.8 --- .github/workflows/test_and_deploy.yml | 2 +- pyproject.toml | 4 +--- tox.ini | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index aed08a0..d7dcf21 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: # Run all supported Python versions on linux - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] os: [ubuntu-latest] # Include one windows and macos run include: diff --git a/pyproject.toml b/pyproject.toml index 11bca1d..21bf0ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "fancylog" authors = [{name = "Adam Tyson", email= "code@adamltyson.com"}] description = "Fancier logging in Python" readme = "README.md" -requires-python = ">=3.6.0" +requires-python = ">=3.9.0" dynamic = ["version"] license = {text = "BSD-3-Clause"} @@ -11,8 +11,6 @@ license = {text = "BSD-3-Clause"} classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", diff --git a/tox.ini b/tox.ini index f1581e8..1f3844f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,9 @@ [tox] -envlist = py{38,39,310,311} +envlist = py{39,310,311} isolated_build = True [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 From caf988db804c4872eaffd7bc81588b01036d6c9d Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Wed, 4 Oct 2023 16:52:23 +0100 Subject: [PATCH 3/7] Update URLs --- README.md | 6 +++--- pyproject.toml | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7da373a..a79b2a4 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![PyPI](https://img.shields.io/pypi/v/fancylog.svg)](https://pypi.org/project/fancylog) [![Downloads](https://pepy.tech/badge/fancylog)](https://pepy.tech/project/fancylog) [![Wheel](https://img.shields.io/pypi/wheel/fancylog.svg)](https://pypi.org/project/fancylog) -[![Development Status](https://img.shields.io/pypi/status/fancylog.svg)](https://github.com/adamltyson/fancylog) +[![Development Status](https://img.shields.io/pypi/status/fancylog.svg)](https://github.com/neuroinformatics-unit/fancylog) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black) -[![Contributions](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg)](https://github.com/adamltyson/fancylog) +[![Contributions](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg)](https://github.com/neuroinformatics-unit/fancylog) # fancylog Fancier logging with python. @@ -33,7 +33,7 @@ pip install fancylog[git] #### To run example ```bash -git clone https://github.com/adamltyson/fancylog +git clone https://github.com/neuroinformatics-unit/fancylog pip install -e . python fancylog/example.py /path/to/output/log/dir ``` diff --git a/pyproject.toml b/pyproject.toml index 21bf0ee..1f11a8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,11 +21,11 @@ classifiers = [ dependencies = ["rich"] [project.urls] -homepage = "https://github.com/adamltyson/fancylog" -bug_tracker = "https://github.com/adamltyson/fancylog/issues" -documentation = "https://github.com/adamltyson/fancylog" -source_code = "https://github.com/adamltyson/fancylog" -user_support = "https://github.com/adamltyson/fancylog/issues" +homepage = "https://github.com/neuroinformatics-unit/fancylog" +bug_tracker = "https://github.com/neuroinformatics-unit/fancylog/issues" +documentation = "https://github.com/neuroinformatics-unit/fancylog" +source_code = "https://github.com/neuroinformatics-unit/fancylog" +user_support = "https://github.com/neuroinformatics-unit/fancylog/issues" [project.optional-dependencies] dev = [ From 82cd21aba2e93582afe3c4709579ac773236acac Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Wed, 4 Oct 2023 16:54:04 +0100 Subject: [PATCH 4/7] move tox config to pyproject --- pyproject.toml | 20 ++++++++++++++++++++ tox.ini | 15 --------------- 2 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644 tox.ini diff --git a/pyproject.toml b/pyproject.toml index 1f11a8f..a41dc99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,3 +103,23 @@ ignore = [ [tool.ruff] line-length = 79 exclude = ["__init__.py","build",".eggs"] + + +[tool.tox] +legacy_tox_ini = """ +[tox] +envlist = py{39,310,311} +isolated_build = True + +[gh-actions] +python = + 3.9: py39 + 3.10: py310 + 3.11: py311 + +[testenv] +extras = + dev +commands = + pytest -v --color=yes --cov=fancylog --cov-report=xml +""" \ No newline at end of file diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 1f3844f..0000000 --- a/tox.ini +++ /dev/null @@ -1,15 +0,0 @@ -[tox] -envlist = py{39,310,311} -isolated_build = True - -[gh-actions] -python = - 3.9: py39 - 3.10: py310 - 3.11: py311 - -[testenv] -extras = - dev -commands = - pytest -v --color=yes --cov=fancylog --cov-report=xml From 9b1ea2776969fd75d3f938c8467f8a733d35d361 Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Wed, 4 Oct 2023 16:54:51 +0100 Subject: [PATCH 5/7] remove seperate pytest config --- pyproject.toml | 2 +- pytest.ini | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 pytest.ini diff --git a/pyproject.toml b/pyproject.toml index a41dc99..a4974f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -122,4 +122,4 @@ extras = dev commands = pytest -v --color=yes --cov=fancylog --cov-report=xml -""" \ No newline at end of file +""" diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index e04a948..0000000 --- a/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -addopts = --cov=fancylog From eeab8aaf600c8a0bb84fefa18dd7595a228ed922 Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Wed, 4 Oct 2023 16:55:28 +0100 Subject: [PATCH 6/7] remove deps in precommit --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a4974f5..1f271f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,11 +33,7 @@ dev = [ "pytest-cov", "coverage", "tox", - "black", - "isort", - "mypy", "pre-commit", - "ruff", "setuptools_scm", ] From 2d8fc985a1365344575659518d87086a86074b92 Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Wed, 4 Oct 2023 16:56:03 +0100 Subject: [PATCH 7/7] Add check manifest to precommit --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e8689f1..02b2d7d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,3 +29,9 @@ repos: - id: mypy additional_dependencies: - types-setuptools + - repo: https://github.com/mgedmin/check-manifest + rev: "0.49" + hooks: + - id: check-manifest + args: [--no-build-isolation] + additional_dependencies: [setuptools-scm]