-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Move to `pyproject.toml` - Update support to 3.8+
- Loading branch information
Showing
14 changed files
with
89 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,55 @@ | ||
BEHAVE = behave | ||
MAKE = make | ||
PYTHON = python | ||
SETUP = $(PYTHON) ./setup.py | ||
TWINE = $(PYTHON) -m twine | ||
|
||
.PHONY: accept build clean cleandocs coverage docs opendocs | ||
|
||
.PHONY: help | ||
help: | ||
@echo "Please use \`make <target>' where <target> is one or more of" | ||
@echo " accept run acceptance tests using behave" | ||
@echo " clean delete intermediate work product and start fresh" | ||
@echo " cleandocs delete cached HTML documentation and start fresh" | ||
@echo " coverage run nosetests with coverage" | ||
@echo " docs build HTML documentation using Sphinx (incremental)" | ||
@echo " opendocs open local HTML documentation in browser" | ||
@echo " readme update README.html from README.rst" | ||
@echo " sdist generate a source distribution into dist/" | ||
@echo " upload upload distribution tarball to PyPI" | ||
|
||
@echo " accept run acceptance tests using behave" | ||
@echo " build generate both sdist and wheel suitable for upload to PyPI" | ||
@echo " clean delete intermediate work product and start fresh" | ||
@echo " cleandocs delete cached HTML documentation and start fresh" | ||
@echo " coverage run nosetests with coverage" | ||
@echo " docs build HTML documentation using Sphinx (incremental)" | ||
@echo " opendocs open local HTML documentation in browser" | ||
@echo " test-upload upload distribution to TestPyPI" | ||
@echo " upload upload distribution tarball to PyPI" | ||
|
||
.PHONY: accept | ||
accept: | ||
$(BEHAVE) --stop | ||
|
||
.PHONY: build | ||
build: | ||
rm -rf dist | ||
$(SETUP) bdist_wheel sdist | ||
python -m build | ||
twine check dist/* | ||
|
||
.PHONY: clean | ||
clean: | ||
find . -type f -name \*.pyc -exec rm {} \; | ||
find . -type f -name .DS_Store -exec rm {} \; | ||
rm -rf dist .coverage | ||
|
||
.PHONY: cleandocs | ||
cleandocs: | ||
$(MAKE) -C docs clean | ||
|
||
.PHONY: coverage | ||
coverage: | ||
py.test --cov-report term-missing --cov=pptx --cov=tests | ||
|
||
.PHONY: docs | ||
docs: | ||
$(MAKE) -C docs html | ||
|
||
.PHONY: opendocs | ||
opendocs: | ||
open docs/.build/html/index.html | ||
|
||
.PHONY: test-upload | ||
test-upload: build | ||
$(TWINE) upload --repository testpypi dist/* | ||
twine upload --repository testpypi dist/* | ||
|
||
.PHONY: upload | ||
upload: clean build | ||
$(TWINE) upload dist/* | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,45 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.0.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "python-pptx" | ||
authors = [{name = "Steve Canny", email = "[email protected]"}] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"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", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Office/Business :: Office Suites", | ||
"Topic :: Software Development :: Libraries", | ||
] | ||
dependencies = [ | ||
"Pillow>=3.3.2", | ||
"XlsxWriter>=0.5.7", | ||
"lxml>=3.1.0", | ||
"typing_extensions>=4.9.0", | ||
] | ||
description = "Create, read, and update PowerPoint 2007+ (.pptx) files." | ||
dynamic = ["version"] | ||
keywords = ["powerpoint", "ppt", "pptx", "openxml", "office"] | ||
license = { text = "MIT" } | ||
readme = "README.rst" | ||
requires-python = ">=3.8" | ||
|
||
[project.urls] | ||
Changelog = "https://github.com/scanny/python-pptx/blob/master/HISTORY.rst" | ||
Documentation = "https://python-pptx.readthedocs.io/en/latest/" | ||
Homepage = "https://github.com/scanny/python-pptx" | ||
Repository = "https://github.com/scanny/python-pptx" | ||
|
||
[tool.black] | ||
line-length = 100 | ||
|
||
|
@@ -98,3 +140,6 @@ ignore = [ | |
|
||
[tool.ruff.lint.isort] | ||
known-first-party = ["pptx"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "pptx.__version__"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-r requirements-test.txt | ||
build | ||
ruff | ||
setuptools>=61.0.0 | ||
twine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Sphinx==1.8.6 | ||
Jinja2==2.11.3 | ||
MarkupSafe==0.23 | ||
alabaster<0.7.14 | ||
-e . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ pytest>=2.5 | |
pytest-coverage | ||
pytest-xdist | ||
ruff | ||
tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,9 @@ | ||
# | ||
# Configuration for tox and pytest | ||
|
||
[flake8] | ||
exclude = dist,docs,*.egg-info,.git,lab,ref,_scratch,spec,.tox | ||
ignore = | ||
# -- E203 - whitespace before ':'. Black disagrees for slice expressions. | ||
E203, | ||
|
||
# -- W503 - line break before binary operator. Black has a different opinion about | ||
# -- this, that binary operators should appear at the beginning of new-line | ||
# -- expression segments. I agree because right is ragged and left lines up. | ||
W503 | ||
max-line-length = 88 | ||
|
||
[tox] | ||
envlist = py27, py38, py311 | ||
requires = virtualenv<20.22.0 | ||
skip_missing_interpreters = false | ||
envlist = py38, py39, py310, py311, py312 | ||
|
||
[testenv] | ||
deps = | ||
behave==1.2.5 | ||
lxml>=3.1.0 | ||
Pillow>=3.3.2 | ||
pyparsing>=2.0.1 | ||
pytest | ||
XlsxWriter>=0.5.7 | ||
deps = -rrequirements-test.txt | ||
|
||
commands = | ||
py.test -qx | ||
behave --format progress --stop --tags=-wip | ||
|
||
[testenv:py27] | ||
deps = | ||
behave==1.2.5 | ||
lxml>=3.1.0 | ||
mock | ||
Pillow>=3.3.2 | ||
pyparsing>=2.0.1 | ||
pytest | ||
XlsxWriter>=0.5.7 |