Skip to content

Commit

Permalink
Merge pull request #161 from trungdong/dev
Browse files Browse the repository at this point in the history
Using pyproject.toml
  • Loading branch information
trungdong authored Jan 14, 2025
2 parents c511b95 + 88bc9e8 commit cff62ef
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 114 deletions.
7 changes: 7 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[bumpversion]
current_version = 2.0.1
commit = True
tag = True
tag_name = {new_version}

[bumpversion:file:src/prov/__init__.py]
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
16 changes: 12 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

sphinx:
configuration: docs/conf.py
configuration: docs/conf.py

formats: all

python:
version: 3
install:
- requirements: requirements.txt
install:
- path: .
extra_requirements:
- xml
- rdf

10 changes: 5 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ Ready to contribute? Here's how to set up `prov` for local development.
$ cd prov/
$ pip install -r requirements-dev.txt

(NOTE: To be updated. The above step is no longer correct.)

4. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature
Expand Down Expand Up @@ -97,8 +99,6 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.6+ and for PyPy3.
Check https://travis-ci.org/trungdong/prov/pull_requests
and make sure that the tests pass for all supported Python versions.
(See `pyenv <https://github.com/yyuu/pyenv>`_ for help on setting up
multiple versions of Python locally for testing.)
3. The pull request should work for Python 3.9+ and for PyPy3.
Look for the automated checks at the bottom of your pull request and make sure that
the tests pass for all supported Python versions.
8 changes: 6 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
History
-------

New changes
^^^^^^^^^^^
* Removed support for EOL Python 3.8

2.0.1 (2024-06-10)
^^^^^^^^^^^^^^^^^^
* Removed support for EOL Python 3.6 and 3.7
* Minor documentation update (#153)
* Stopped using deepcopy when duplicating Namespace (#158
* Restricting rdflib package version to "<7" (#156
* Stopped using deepcopy when duplicating Namespace (#158)
* Restricting rdflib package version to "<7" (#156)
* Raise an exception when an empty URI is registered as a namespace (#142)
* Ensure rdflib 6+ returns bytes when serializing tests (fixed #151)
* Removed fancy label output for bundle
Expand Down
69 changes: 68 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,77 @@
[project]
name = "prov"
dynamic = ["version"]
description = "A library for W3C Provenance Data Model supporting PROV-JSON, PROV-XML and PROV-O (RDF)"
readme = "README.rst"
authors = [
{ name = "Trung Dong Huynh", email = "[email protected]" }
]
keywords = ["provenance", "graph", "model", "PROV", "PROV-DM", "PROV-JSON", "W3C", "PROV-XML", "PROV-N", "PROV-O", "RDF"]
license = {file = "LICENSE"}
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Security",
"Topic :: System :: Logging",
]
requires-python = ">=3.9"
dependencies = [
"networkx>=2.0",
# Supporting graphic outputs (e.g. PNG, SVG, PDF) - a local graphviz is required
"pydot>=1.2.0",
"python-dateutil>=2.2", # TODO: is this really needed?
]

[project.optional-dependencies]
rdf = [
"rdflib>=4.2.1,<7",
]
xml = [
"lxml>=3.3.5",
]

[project.urls]
Homepage = "https://github.com/trungdong/prov"
Documentation = "https://prov.readthedocs.io"
Repository = "https://github.com/trungdong/prov"
Issues = "https://github.com/trungdong/prov/issues"
Changelog = "https://prov.readthedocs.io/en/latest/history.html"

[build-system]
requires = ["setuptools>=40.8.0", "wheel"] # PEP 508 specifications.
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
version = {attr = "prov.__version__"}

[dependency-groups]
dev = [
"black>=24.10.0",
"bumpversion>=0.6.0",
"coverage>=7.6.10",
"flake8>=7.1.1",
"setuptools>=75.8.0",
"sphinx>=8.1.3",
"tox>=4.23.2",
"wheel>=0.45.1",
]

[tool.black]
line-length = 88
target-version = ['py36']
target-version = ["py39", "py310", "py311", "py312"]
include = '\.pyi?$'
exclude = '''
(
Expand Down
8 changes: 0 additions & 8 deletions requirements-dev.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

13 changes: 0 additions & 13 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
[bumpversion]
current_version = 2.0.1
commit = True
tag = True
tag_name = {new_version}

[bumpversion:file:setup.py]

[bumpversion:file:src/prov/__init__.py]

[metadata]
description-file = README.rst

[flake8]
max-line-length = 88
extend-ignore = E203, W503
71 changes: 1 addition & 70 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,74 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
import pathlib

here = pathlib.Path(__file__).parent.resolve()

long_description = (here / "README.rst").read_text(encoding="utf-8")

requirements = ["python-dateutil>=2.2", "networkx>=2.0", "lxml>=3.3.5", "rdflib>=4.2.1,<7"]

test_requirements = ["pydot>=1.2.0"]
from setuptools import setup

setup(
name="prov",
version="2.0.1",
description="A library for W3C Provenance Data Model supporting PROV-JSON, "
"PROV-XML and PROV-O (RDF)",
long_description=long_description,
author="Trung Dong Huynh",
author_email="[email protected]",
url="https://github.com/trungdong/prov",
project_urls={
"Bug Reports": "https://github.com/trungdong/prov/issues",
"Source": "https://github.com/trungdong/prov",
},
packages=find_packages(where="src"),
package_dir={"": "src"},
python_requires=">=3.6, <4",
scripts=["scripts/prov-convert", "scripts/prov-compare"],
include_package_data=True,
install_requires=requirements,
extras_require={
"dot": ["pydot>=1.2.0"],
},
license="MIT",
zip_safe=False,
keywords=[
"provenance",
"graph",
"model",
"PROV",
"PROV-DM",
"PROV-JSON",
"W3C",
"PROV-XML",
"PROV-N",
"PROV-O",
"RDF",
],
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"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",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Security",
"Topic :: System :: Logging",
],
test_suite="prov.tests",
tests_require=test_requirements,
)
4 changes: 2 additions & 2 deletions src/prov/tests/test_dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import unittest

# Skipping SVG tests if pydot is not installed
from pkgutil import find_loader
from importlib.util import find_spec

if find_loader("pydot") is not None:
if find_spec("pydot") is not None:

from prov.dot import prov_to_dot
from prov.tests.test_model import AllTestsBase
Expand Down
8 changes: 5 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = python3.8, python3.9, python3.10, python3.11, python3.12, pypy3
envlist = python3.9, python3.10, python3.11, python3.12, pypy3

# Define the minimal tox version required to run;
# if the host tox is less than this the tool with create an environment and
Expand All @@ -16,9 +16,11 @@ isolated_build = true
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/src/prov
commands =
check-manifest --ignore 'tox.ini,.coveragerc,.editorconfig,tests/**,cla/**,requirements*.txt,Makefile,.readthedocs.yml'
check-manifest --ignore 'tox.ini,.bumpversion.cfg,.coveragerc,.editorconfig,tests/**,cla/**,Makefile,.readthedocs.yml'
python setup.py check -m -r -s
python setup.py test
python -m unittest discover -s src/
deps =
check-manifest >= 0.42
readme_renderer
rdflib>=4.2.1,<7
lxml>=3.3.5

0 comments on commit cff62ef

Please sign in to comment.