Skip to content

Commit

Permalink
Move to pyproject.toml; CI python 3.12; drop python 3.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer committed Oct 18, 2023
1 parent b68358b commit 8bf1ac7
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -18,7 +18,7 @@ jobs:
run: |
python -mpip install --upgrade pip setuptools wheel pytest pytest-cov
case '${{ matrix.python-version }}' in
3.6)
3.7)
pip install ipython==4.1.0;;
esac
python -mpip install .
Expand Down
39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[build-system]
requires = ["setuptools>=61", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "ipython-autoimport"
description = "Automagically import missing modules in IPython."
readme = "README.rst"
authors = [{name = "Antony Lee"}]
urls = {Repository = "https://github.com/anntzer/ipython-autoimport"}
license = {text = "zlib"}
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: IPython",
"License :: OSI Approved :: zlib/libpng License",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.7"
dependencies = [
"ipython>=4.1", # IPython#8985 is needed for tests to pass(?).
"importlib_metadata; python_version<'3.8'",
]
dynamic = ["version"]

[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "node-and-date"
fallback_version = "0+unknown"

[tool.coverage.run]
branch = true
source_pkgs = ["ipython_autoimport"]

[tool.pytest.ini_options]
filterwarnings = [
"error",
"ignore::DeprecationWarning",
"error::DeprecationWarning:ipython_autoimport",
]
30 changes: 0 additions & 30 deletions setup.py

This file was deleted.

9 changes: 3 additions & 6 deletions lib/ipython_autoimport.py → src/ipython_autoimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@
from IPython.utils import PyColorize

try:
import importlib.metadata as importlib_metadata
import importlib.metadata as _im
except ImportError:
try:
import importlib_metadata
except ImportError:
importlib_metadata = None
import importlib_metadata as _im
try:
__version__ = importlib_metadata.version("ipython-autoimport")
__version__ = _im.version("ipython-autoimport")
except (AttributeError, ImportError): # AttrError if i_m is missing.
__version__ = "(unknown version)"

Expand Down

0 comments on commit 8bf1ac7

Please sign in to comment.