Skip to content

Commit e19786f

Browse files
committed
Move fully to pyproject.toml
This change also removes compatiblity with EOL'ed python 3.6 and 3.7 This removes the need for custom logic in setup.py and reduces duplication of project metadata.
1 parent 1931f8c commit e19786f

File tree

4 files changed

+33
-134
lines changed

4 files changed

+33
-134
lines changed

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-22.04
2525
strategy:
2626
matrix:
27-
python: [ '3.7', '3.8', '3.12' ]
27+
python: [ '3.8', '3.12' ]
2828
steps:
2929
- uses: actions/checkout@v5
3030

patch_ng.py

100755100644
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2929
SOFTWARE.
3030
"""
31-
__author__ = "Conan.io <[email protected]>"
32-
__version__ = "1.20.0-dev"
33-
__license__ = "MIT"
34-
__url__ = "https://github.com/conan-io/python-patch"
31+
from __future__ import print_function
32+
import importlib.metadata
3533

3634
import codecs
3735
import copy
@@ -1389,7 +1387,7 @@ def main():
13891387
opt = OptionParser(usage="1. %prog [options] unified.diff\n"
13901388
" 2. %prog [options] http://host/patch\n"
13911389
" 3. %prog [options] -- < unified.diff",
1392-
version="python-patch %s" % __version__)
1390+
version="python-patch %s" % importlib.metadata.version('patch_ng'))
13931391
opt.add_option("-q", "--quiet", action="store_const", dest="verbosity",
13941392
const=0, help="print only warnings and errors", default=1)
13951393
opt.add_option("-v", "--verbose", action="store_const", dest="verbosity",

pyproject.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
[project]
2+
name = "patch-ng"
3+
version = "1.19.0"
4+
requires-python = ">=3.8"
5+
6+
description = "Library to parse and apply unified diffs."
7+
readme = "README.md"
8+
license = "MIT"
9+
authors = [
10+
{ name = "Conan.io", email = "[email protected]" }
11+
]
12+
13+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
14+
classifiers = [
15+
'Development Status :: 5 - Production/Stable',
16+
'Intended Audience :: Developers',
17+
'Topic :: Software Development :: Build Tools',
18+
'Programming Language :: Python :: 3',
19+
'Programming Language :: Python :: 3.8'
20+
]
21+
22+
keywords = ['patch', 'parse', 'diff', 'strip', 'diffstat']
23+
24+
[project.urls]
25+
Repository = "https://github.com/conan-io/python-patch-ng/"
26+
127
[build-system]
228
requires = ["setuptools", "wheel"]
329
build-backend = "setuptools.build_meta"
30+
31+
[tool.setuptools.package-data]
32+
patch_ng = ["LICENSE", "README.md"]

setup.py

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)