Skip to content

Commit

Permalink
🔧 MAINTAIN: setuptools -> flit (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell authored Apr 28, 2022
1 parent f9c2f33 commit e72c212
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 149 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
tests:

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
Expand All @@ -50,7 +51,7 @@ jobs:
# for some reason the tests/conftest.py::check_nbs fixture breaks pytest-cov's cov-report outputting
# this is why we run `coverage xml` afterwards (required by codecov)
- name: Upload to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7 && github.repository == 'executablebooks/jupyter-cache'
if: github.repository == 'executablebooks/jupyter-cache'
uses: codecov/codecov-action@v1
with:
name: jupyter-cache-pytests-py3.7
Expand All @@ -65,18 +66,18 @@ jobs:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: "3.8"
- name: Build package
run: |
pip install build
python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.1.0
with:
user: __token__
password: ${{ secrets.PYPI_KEY }}
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: "3.8"
- name: install flit
run: |
pip install flit~=3.4
- name: Build and publish
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}
18 changes: 3 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,15 @@ exclude: >
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/mgedmin/check-manifest
rev: "0.47"
hooks:
- id: check-manifest
args: [--no-build-isolation]
additional_dependencies: [setuptools>=46.4.0]

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v2.32.0
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand All @@ -35,7 +28,7 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.3.0
hooks:
- id: black

Expand All @@ -49,8 +42,3 @@ repos:
# hooks:
# - id: mypy
# additional_dependencies: []

# - repo: https://github.com/asottile/setup-cfg-fmt
# rev: v1.17.0
# hooks:
# - id: setup-cfg-fmt
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 ExecutableBookProject
Copyright (c) 2022 ExecutableBookProject

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 0 additions & 13 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# "sphinx.ext.viewcode",
]
myst_enable_extensions = ["colon_fence", "deflist"]
jupyter_execute_notebooks = "off"
nb_execution_mode = "off"
html_theme_options = {
"repository_url": "https://github.com/executablebooks/jupyter-cache",
"use_repository_button": True,
Expand Down
96 changes: 94 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,100 @@
[build-system]
requires = ["setuptools>=46.4.0", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "jupyter-cache"
dynamic = ["version"]
description = "A defined interface for working with a cache of jupyter notebooks."
authors = [{name = "Chris Sewell", email = "chrisj_sewell@hotmail.com"}]
readme = "README.md"
license = {file = "LICENSE"}
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Sphinx :: Extension",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries :: Python Modules",
]
keywords = ["sphinx extension material design web components"]
requires-python = "~=3.7"
dependencies = [
"attrs",
"click",
"importlib-metadata",
"nbclient>=0.2,<0.6",
"nbformat",
"pyyaml",
"sqlalchemy>=1.3.12,<1.5",
"tabulate",
]

[project.urls]
Homepage = "https://github.com/executablebooks/jupyter-cache"
Documentation = "https://jupyter-cache.readthedocs.io"

[project.entry-points."jcache.executors"]
local-serial = "jupyter_cache.executors.basic:JupyterExecutorLocalSerial"
temp-serial = "jupyter_cache.executors.basic:JupyterExecutorTempSerial"
local-parallel = "jupyter_cache.executors.basic:JupyterExecutorLocalMproc"
temp-parallel = "jupyter_cache.executors.basic:JupyterExecutorTempMproc"

[project.entry-points."jcache.readers"]
nbformat = "jupyter_cache.readers:nbf_reader"
jupytext = "jupyter_cache.readers:jupytext_reader"

[project.optional-dependencies]
cli = ["click-log"]
code_style = ["pre-commit~=2.12"]
rtd = [
"nbdime",
"ipykernel",
"jupytext",
"myst-nb @ git+https://github.com/executablebooks/MyST-NB.git",
"sphinx-book-theme~=0.3.0",
"sphinx-copybutton",
]
testing = [
"nbdime",
"coverage",
"ipykernel",
"jupytext",
"matplotlib",
"nbformat>=5.1",
"numpy",
"pandas",
"pytest>=6,<7",
"pytest-cov",
"pytest-regressions",
"sympy",
]

[project.scripts]
jcache = "jupyter_cache.cli.commands.cmd_main:jcache"

[tool.flit.module]
name = "jupyter_cache"

[tool.flit.sdist]
exclude = [
"docs/",
"tests/",
]

[tool.isort]
profile = "black"
src_paths = ["jupyter_cache", "tests"]
force_sort_within_sections = true

[tool.mypy]
show_error_codes = true
warn_unused_ignores = true
warn_redundant_casts = true
no_implicit_optional = true
strict_equality = true
93 changes: 0 additions & 93 deletions setup.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions setup.py

This file was deleted.

8 changes: 6 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ envlist = py38
[testenv]
usedevelop = true

[testenv:py{36,37,38,39}]
[testenv:py{37,38,39,310}]
extras = testing
deps =
black
Expand Down Expand Up @@ -46,4 +46,8 @@ commands_post = echo "open file://{toxinidir}/docs/_build/{posargs:html}/index.h


[pytest]
addopts = --ignore=setup.py --ignore=_archive/
addopts = --ignore=_archive/

[flake8]
max-line-length = 100
extend-ignore = E203

0 comments on commit e72c212

Please sign in to comment.