From c14ccb0049e2b44f8b368c6e87e5345ac0e28cdc Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 10 Nov 2022 15:50:41 +0300 Subject: [PATCH 1/5] Migrated the metadata from `setup.py` into `setup.cfg`. Got rid of `setup.py`. --- pypi_reminder.txt | 6 +++--- pyproject.toml | 3 +++ setup.cfg | 42 ++++++++++++++++++++++++++++++++++++- setup.py | 53 ----------------------------------------------- 4 files changed, 47 insertions(+), 57 deletions(-) create mode 100644 pyproject.toml delete mode 100755 setup.py diff --git a/pypi_reminder.txt b/pypi_reminder.txt index 219f0d3..aa7ab47 100644 --- a/pypi_reminder.txt +++ b/pypi_reminder.txt @@ -1,9 +1,9 @@ # thats the only way to get md into pypi: git push (for the images) -vi setup.py -> add new version. -rm -rf dist/ -python setup.py sdist +vi setup.cfg -> add new version. +rm -rf build/ dist/ +python3 -m build -nwsx . twine upload dist/* diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b464d1d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=42.2"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index aac6317..60da1e1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,45 @@ [metadata] -description-file = README.md +name = mdv +version = 1.7.4 +author = Axiros GmbH +author_email = gk@axiros.com +description = Terminal Markdown Viewer +keywords = + markdown + markup + terminal + hilighting + syntax + source code +url = http://github.com/axiros/terminal_markdown_viewer +download_url = http://github.com/axiros/terminal_markdown_viewer/tarball/ +long_description = file: README.md +long_description_content_type = text/markdown +classifiers = + Programming Language :: Python + Natural Language :: English + Operating System :: POSIX + Topic :: Text Processing :: Markup + License :: OSI Approved :: BSD License + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + +[options] +packages = find: +install_requires = pygments; markdown +include_package_data = True +tests_require = pytest + +[options.packages.find] +include = mdv, mdv.* + +[options.entry_points] +console_scripts = mdv = mdv:run + +[options.extras_require] +yaml = pyyaml + [report] exclude_lines = pragma: no cover diff --git a/setup.py b/setup.py deleted file mode 100755 index 46c7603..0000000 --- a/setup.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python2.7 -# coding: utf-8 - -"""_ -# Mdv installation - -## Usage - - [sudo] ./setup.py install - ----- -""" - -import os -from setuptools import setup, find_packages - -version = '1.7.4' - -with open(os.path.join(os.path.dirname(__file__), 'README.md')) as fd: - md = fd.read() - -# images hack for pypi: -gh = 'https://raw.githubusercontent.com/axiros/terminal_markdown_viewer/master' -md = md.replace('src="./', 'src="%s/' % gh) - -setup( - name='mdv', - version=version, - packages=find_packages(), - author='Axiros GmbH', - author_email='gk@axiros.com', - description='Terminal Markdown Viewer', - install_requires=['pygments', 'markdown'], - extras_require={'yaml': 'pyyaml'}, - long_description=md, - long_description_content_type='text/markdown', - include_package_data=True, - url='http://github.com/axiros/terminal_markdown_viewer', - download_url='http://github.com/axiros/terminal_markdown_viewer/tarball/', - keywords=['markdown', 'markup', 'terminal', 'hilighting', 'syntax', 'source code',], - tests_require=['pytest'], - classifiers=[ - 'Programming Language :: Python', - 'Natural Language :: English', - 'Operating System :: POSIX', - 'Topic :: Text Processing :: Markup', - 'License :: OSI Approved :: BSD License', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - ], - entry_points={'console_scripts': ['mdv = mdv:run']}, -) From 032e6ca0a1691324dc5b9ac3d10468849d5c1485 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 10 Nov 2022 16:02:24 +0300 Subject: [PATCH 2/5] Remove `setup.py` mention from everywhere. --- README.md | 3 +-- mdv/misc/results_perftests/out_commonmark.html | 12 ++++++------ mdv/misc/results_perftests/out_markdown.html | 12 ++++++------ mdv/misc/results_perftests/out_mistletoe.html | 12 ++++++------ mdv/misc/results_perftests/out_mistletoe_ansi.html | 11 +++++------ mdv/misc/results_perftests/out_paka.html | 12 ++++++------ mdv/misc/results_perftests/out_paka_breaks.html | 12 ++++++------ mdv/misc/results_perftests/out_paka_xml.html | 12 ++++++------ mdv/misc/test_md.md | 9 ++++----- 9 files changed, 46 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index a5e947a..497da53 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,6 @@ You can also use mdv as a **source code** viewer, best when you have docstrings from ```python -~/terminal_markdown_viewer $ cat setup.py #!/usr/bin/env python2.7 # coding: utf-8 @@ -92,7 +91,7 @@ from ## Usage - [sudo] ./setup.py install + pip install --upgrade . ---- """ diff --git a/mdv/misc/results_perftests/out_commonmark.html b/mdv/misc/results_perftests/out_commonmark.html index 89431b0..a846161 100644 --- a/mdv/misc/results_perftests/out_commonmark.html +++ b/mdv/misc/results_perftests/out_commonmark.html @@ -77,7 +77,7 @@

You can also use mdv as a source code viewer, best when you have docstrings with markdown in your code:

from

-
~/terminal_markdown_viewer $ cat setup.py
+

 #!/usr/bin/env python2.7
 # coding: utf-8
 
@@ -86,7 +86,7 @@
 
 ## Usage
 
-    [sudo] ./setup.py install
+    [sudo] pip install --upgrade .
 
 ----
 """
@@ -156,9 +156,9 @@ 

Manual Install: Setup

Distribution via setuptools. If setuptools is not installed, run:

pip install setuptools
 
-

Use the setup.py provided inside, I.e. run:

-
sudo ./setup.py install
-(or ./setup.py install --user to install only for the current user)
+

Use pip, I.e. run:

+
sudo pip install --upgrade .
+(or just pip install --upgrade . to install only for the current user)
 

Usage

CLI

@@ -448,4 +448,4 @@

Sept 2018:

| User | Any | | Campaign | Any | | Support Portal | [cpeid, '=', a cpeid] |

- \ No newline at end of file + diff --git a/mdv/misc/results_perftests/out_markdown.html b/mdv/misc/results_perftests/out_markdown.html index 3b84c04..835cbc5 100644 --- a/mdv/misc/results_perftests/out_markdown.html +++ b/mdv/misc/results_perftests/out_markdown.html @@ -78,7 +78,7 @@

You can also use mdv as a source code viewer, best when you have docstrings with markdown in your code:

from

-
~/terminal_markdown_viewer $ cat setup.py
+

 #!/usr/bin/env python2.7
 # coding: utf-8
 
@@ -87,7 +87,7 @@
 
 ## Usage
 
-    [sudo] ./setup.py install
+    [sudo] pip install --upgrade .
 
 ----
 """
@@ -157,9 +157,9 @@ 

Manual Install: Setup

Distribution via setuptools. If setuptools is not installed, run:

pip install setuptools
 
-

Use the setup.py provided inside, I.e. run:

-
sudo ./setup.py install
-(or ./setup.py install --user to install only for the current user)
+

Use pip, I.e. run:

+
sudo pip install --upgrade .
+(or just pip install --upgrade . to install only for the current user)
 

Usage

CLI

@@ -471,4 +471,4 @@

Sept 2018:

[cpeid, '=', a cpeid] - \ No newline at end of file + diff --git a/mdv/misc/results_perftests/out_mistletoe.html b/mdv/misc/results_perftests/out_mistletoe.html index 8cac986..7d97462 100644 --- a/mdv/misc/results_perftests/out_mistletoe.html +++ b/mdv/misc/results_perftests/out_mistletoe.html @@ -77,7 +77,7 @@

You can also use mdv as a source code viewer, best when you have docstrings with markdown in your code:

from

-
~/terminal_markdown_viewer $ cat setup.py
+

 #!/usr/bin/env python2.7
 # coding: utf-8
 
@@ -86,7 +86,7 @@
 
 ## Usage
 
-    [sudo] ./setup.py install
+    [sudo] pip install --upgrade .
 
 ----
 """
@@ -173,9 +173,9 @@ 

Manual Install: Setup

Distribution via setuptools. If setuptools is not installed, run:

pip install setuptools
 
-

Use the setup.py provided inside, I.e. run:

-
sudo ./setup.py install
-(or ./setup.py install --user to install only for the current user)
+

Use pip, I.e. run:

+
sudo pip install --upgrade .
+(or just pip install --upgrade . to install only for the current user)
 

Usage

CLI

@@ -516,4 +516,4 @@

Sept 2018:

- \ No newline at end of file + diff --git a/mdv/misc/results_perftests/out_mistletoe_ansi.html b/mdv/misc/results_perftests/out_mistletoe_ansi.html index 49bf4aa..76add91 100644 --- a/mdv/misc/results_perftests/out_mistletoe_ansi.html +++ b/mdv/misc/results_perftests/out_mistletoe_ansi.html @@ -135,7 +135,6 @@ from \begin{lstlisting}[language=python] -~/terminal_markdown_viewer $ cat setup.py #!/usr/bin/env python2.7 # coding: utf-8 @@ -144,7 +143,7 @@ ## Usage - [sudo] ./setup.py install + [sudo] pip install --upgrade . ---- """ @@ -273,11 +272,11 @@ pip install setuptools \end{lstlisting} -Use the setup.py provided inside, I.e. run: +Use pip, I.e. run: \begin{lstlisting}[language=] -sudo ./setup.py install -(or ./setup.py install --user to install only for the current user) +sudo pip install --upgrade . +(or just pip install --upgrade . to install only for the current user) \end{lstlisting} \subsection{Usage} @@ -686,4 +685,4 @@ Support Portal & \verb|[cpeid, '=', a cpeid]| \end{tabular} \end{document} - \ No newline at end of file + diff --git a/mdv/misc/results_perftests/out_paka.html b/mdv/misc/results_perftests/out_paka.html index d84a5f6..a9dcc62 100644 --- a/mdv/misc/results_perftests/out_paka.html +++ b/mdv/misc/results_perftests/out_paka.html @@ -64,7 +64,7 @@

You can also use mdv as a source code viewer, best when you have docstrings with markdown in your code:

from

-
~/terminal_markdown_viewer $ cat setup.py
+

 #!/usr/bin/env python2.7
 # coding: utf-8
 
@@ -73,7 +73,7 @@
 
 ## Usage
 
-    [sudo] ./setup.py install
+    [sudo] pip install --upgrade .
 
 ----
 """
@@ -141,9 +141,9 @@ 

Manual Install: Setup

Distribution via setuptools. If setuptools is not installed, run:

pip install setuptools
 
-

Use the setup.py provided inside, I.e. run:

-
sudo ./setup.py install
-(or ./setup.py install --user to install only for the current user)
+

Use pip, I.e. run:

+
sudo pip install --upgrade .
+(or just pip install --upgrade . to install only for the current user)
 

Usage

CLI

@@ -422,4 +422,4 @@

Sept 2018:

tabletest

| Date | foo | |----------------|--------------------------| | User | Any | | Campaign | Any | | Support Portal | [cpeid, '=', a cpeid] |

- \ No newline at end of file + diff --git a/mdv/misc/results_perftests/out_paka_breaks.html b/mdv/misc/results_perftests/out_paka_breaks.html index e8fe2a6..f1cdb7d 100644 --- a/mdv/misc/results_perftests/out_paka_breaks.html +++ b/mdv/misc/results_perftests/out_paka_breaks.html @@ -77,7 +77,7 @@

You can also use mdv as a source code viewer, best when you have docstrings with markdown in your code:

from

-
~/terminal_markdown_viewer $ cat setup.py
+

 #!/usr/bin/env python2.7
 # coding: utf-8
 
@@ -86,7 +86,7 @@
 
 ## Usage
 
-    [sudo] ./setup.py install
+    [sudo] pip install --upgrade .
 
 ----
 """
@@ -156,9 +156,9 @@ 

Manual Install: Setup

Distribution via setuptools. If setuptools is not installed, run:

pip install setuptools
 
-

Use the setup.py provided inside, I.e. run:

-
sudo ./setup.py install
-(or ./setup.py install --user to install only for the current user)
+

Use pip, I.e. run:

+
sudo pip install --upgrade .
+(or just pip install --upgrade . to install only for the current user)
 

Usage

CLI

@@ -448,4 +448,4 @@

Sept 2018:

| User | Any |
| Campaign | Any |
| Support Portal | [cpeid, '=', a cpeid] |

- \ No newline at end of file + diff --git a/mdv/misc/results_perftests/out_paka_xml.html b/mdv/misc/results_perftests/out_paka_xml.html index 437b825..4400f65 100644 --- a/mdv/misc/results_perftests/out_paka_xml.html +++ b/mdv/misc/results_perftests/out_paka_xml.html @@ -209,7 +209,7 @@ from - ~/terminal_markdown_viewer $ cat setup.py + #!/usr/bin/env python2.7 # coding: utf-8 @@ -218,7 +218,7 @@ ## Usage - [sudo] ./setup.py install + [sudo] pip install --upgrade . ---- """ @@ -417,10 +417,10 @@ pip install setuptools - Use the setup.py provided inside, I.e. run: + Use pip, I.e. run: - sudo ./setup.py install -(or ./setup.py install --user to install only for the current user) + sudo pip install --upgrade . +(or just pip install --upgrade . to install only for the current user) Usage @@ -985,4 +985,4 @@ | - \ No newline at end of file + diff --git a/mdv/misc/test_md.md b/mdv/misc/test_md.md index fbc5a93..900a2d4 100644 --- a/mdv/misc/test_md.md +++ b/mdv/misc/test_md.md @@ -90,7 +90,6 @@ You can also use mdv as a **source code** viewer, best when you have docstrings from ```python -~/terminal_markdown_viewer $ cat setup.py #!/usr/bin/env python2.7 # coding: utf-8 @@ -99,7 +98,7 @@ from ## Usage - [sudo] ./setup.py install + [sudo] pip install --upgrade . ---- """ @@ -179,10 +178,10 @@ Distribution via setuptools. If setuptools is not installed, run: pip install setuptools -Use the setup.py provided inside, I.e. run: +Use pip, I.e. run: - sudo ./setup.py install - (or ./setup.py install --user to install only for the current user) + sudo pip install --upgrade . + (or just pip install --upgrade . to install only for the current user) From 165a0c9ec74cf295415fb1a11f0e255acdac943a Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 10 Nov 2022 17:07:31 +0300 Subject: [PATCH 3/5] Moved the metadata into `PEP 621`-compliant `pyproject.toml` --- pyproject.toml | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 42 ------------------------------------------ 2 files changed, 49 insertions(+), 43 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b464d1d..b29c198 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,51 @@ [build-system] -requires = ["setuptools>=42.2"] +requires = ["setuptools>=61.2"] build-backend = "setuptools.build_meta" + +[project] +name = "mdv" +version = "1.7.4" +authors = [{name = "Axiros GmbH", email = "gk@axiros.com"}] +description = "Terminal Markdown Viewer" +keywords = [ + "markdown", + "markup", + "terminal", + "hilighting", + "syntax", + "source code", +] +classifiers = [ + "Programming Language :: Python", + "Natural Language :: English", + "Operating System :: POSIX", + "Topic :: Text Processing :: Markup", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", +] +dependencies = ["pygments", "markdown"] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.urls] +Homepage = "http://github.com/axiros/terminal_markdown_viewer" +Download = "http://github.com/axiros/terminal_markdown_viewer/tarball/" + +[project.optional-dependencies] +yaml = ["pyyaml"] +testing = ["pytest"] + +[project.scripts] +mdv = "mdv:run" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +include = ["mdv", "mdv.*"] +namespaces = false + diff --git a/setup.cfg b/setup.cfg index 60da1e1..7aae70d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,45 +1,3 @@ -[metadata] -name = mdv -version = 1.7.4 -author = Axiros GmbH -author_email = gk@axiros.com -description = Terminal Markdown Viewer -keywords = - markdown - markup - terminal - hilighting - syntax - source code -url = http://github.com/axiros/terminal_markdown_viewer -download_url = http://github.com/axiros/terminal_markdown_viewer/tarball/ -long_description = file: README.md -long_description_content_type = text/markdown -classifiers = - Programming Language :: Python - Natural Language :: English - Operating System :: POSIX - Topic :: Text Processing :: Markup - License :: OSI Approved :: BSD License - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - -[options] -packages = find: -install_requires = pygments; markdown -include_package_data = True -tests_require = pytest - -[options.packages.find] -include = mdv, mdv.* - -[options.entry_points] -console_scripts = mdv = mdv:run - -[options.extras_require] -yaml = pyyaml - [report] exclude_lines = pragma: no cover From 036268060af32ee36817d16be36375d2a0805b59 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 10 Nov 2022 17:09:05 +0300 Subject: [PATCH 4/5] Started using `setuptools_scm` to populate version automatically. --- pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b29c198..e1a3d04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,9 @@ [build-system] -requires = ["setuptools>=61.2"] +requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4.3"] build-backend = "setuptools.build_meta" [project] name = "mdv" -version = "1.7.4" authors = [{name = "Axiros GmbH", email = "gk@axiros.com"}] description = "Terminal Markdown Viewer" keywords = [ @@ -26,6 +25,7 @@ classifiers = [ "Programming Language :: Python :: 3.7", ] dependencies = ["pygments", "markdown"] +dynamic = ["version"] [project.readme] file = "README.md" @@ -49,3 +49,5 @@ include-package-data = true include = ["mdv", "mdv.*"] namespaces = false +[tool.setuptools_scm] + From 9d89f4ad6604ce38d6936e598c38c4f947b5e6db Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 10 Nov 2022 16:12:35 +0300 Subject: [PATCH 5/5] Removed Kate swap file introduced in 6eba3ad9c9eb3d922ec2368d475247381f2e77c4 --- mdv/misc/.test_md.md.swp | Bin 12288 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 mdv/misc/.test_md.md.swp diff --git a/mdv/misc/.test_md.md.swp b/mdv/misc/.test_md.md.swp deleted file mode 100644 index cf146958156961440e29857ee8081e5c112a72a5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI%Eltp z2tc5|z(DoQ))KkWvGpcnV_mGR9@pQGl@Ndc1Rwwb2tWV=5P-nk3#hz7H~be1)t@X^ zZR1Z{bLN=!WEdhS$PoQ3qi=~dN0I;l