forked from pycontribs/ansi2html
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor packaging and officialy retire support for python <= 3.6 (py…
- Loading branch information
1 parent
6b4d04c
commit c29d512
Showing
5 changed files
with
76 additions
and
125 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
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,8 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools >= 41.0.0", | ||
"setuptools_scm >= 1.15.0", | ||
"setuptools_scm_git_archive >= 1.0", | ||
"wheel", | ||
] | ||
build-backend = "setuptools.build_meta" |
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,47 @@ | ||
[metadata] | ||
name = ansi2html | ||
url = https://github.com/pycontribs/ansi2html | ||
project_urls = | ||
Bug Tracker = https://github.com/pycontribs/ansi2html/issues | ||
Release Management = https://github.com/pycontribs/ansi2html/releases | ||
CI = https://github.com/pycontribs/ansi2html/actions | ||
Source Code = https://github.com/pycontribs/ansi2html | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst | ||
author = 'Ralph Bean' | ||
author_email = 'rbean@redhat.com' | ||
classifiers = | ||
Development Status :: 5 - Production/Stable | ||
License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+) | ||
Intended Audience :: Developers | ||
Intended Audience :: System Administrators | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Topic :: Text Processing | ||
Topic :: Text Processing :: Markup | ||
Topic :: Text Processing :: Markup :: HTML | ||
|
||
[bdist_rpm] | ||
requires = python >= 2.6.6 | ||
python-six >= 1.7.3 | ||
requires = python >= 3.6 | ||
|
||
[options] | ||
use_scm_version = True | ||
python_requires = >=3.6 | ||
packages = find: | ||
include_package_data = True | ||
zip_safe = False | ||
|
||
# These are required during `setup.py` run: | ||
setup_requires = | ||
setuptools_scm >= 1.15.0 | ||
setuptools_scm_git_archive >= 1.0 | ||
|
||
# These are required in actual runtime: | ||
install_requires = | ||
six | ||
|
||
[options.packages.find] | ||
where = . |
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,114 +1,15 @@ | ||
#!/usr/bin/env python | ||
# This file is part of ansi2html | ||
# Convert ANSI (terminal) colours and attributes to HTML | ||
# Copyright (C) 2012 Ralph Bean <rbean@redhat.com> | ||
# | ||
# Inspired by and developed off of the work by pixelbeat and blackjack. | ||
# | ||
# This program is free software: you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation, either version 3 of | ||
# the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see | ||
# <http://www.gnu.org/licenses/>. | ||
|
||
try: | ||
from setuptools import setup, find_packages | ||
except ImportError: | ||
from ez_setup import use_setuptools | ||
use_setuptools() | ||
from setuptools import setup, find_packages | ||
|
||
#! /usr/bin/env python | ||
import site | ||
import sys | ||
import os | ||
|
||
f = open('README.rst') | ||
long_description = f.read().strip() | ||
long_description = long_description.split('split here', 1)[1] | ||
f.close() | ||
|
||
# Ridiculous as it may seem, we need to import multiprocessing and | ||
# logging here in order to get tests to pass smoothly on python 2.7. | ||
try: | ||
# no multiprocessing in python < 2.6 | ||
import multiprocessing | ||
except ImportError: | ||
pass | ||
|
||
import logging | ||
|
||
requires = [ | ||
'six', # For python3 support | ||
] | ||
|
||
if sys.version_info[0] == 2 and sys.version_info[1] < 7: | ||
requires.append("ordereddict") | ||
|
||
data_files = [] | ||
|
||
# We tried installing manpages with setuptools & co but it had all kinds of | ||
# "sandbox violation" issues that were inconsistent and wonky. Therefore, we | ||
# don't do this anymore and instead just ship man pages with the tarball. | ||
if False: | ||
# Conditionally install man pages into the system or the virtualenv. | ||
if 'VIRTUAL_ENV' in os.environ: | ||
man_prefix = os.environ['VIRTUAL_ENV'] | ||
else: | ||
man_prefix = '/usr' | ||
|
||
data_files.append(tuple( | ||
man_prefix + '/share/man/man1/', | ||
['man/ansi2html.1'], | ||
)) | ||
import setuptools | ||
|
||
version = '1.5.2' | ||
# See https://github.com/pypa/pip/issues/7953 | ||
site.ENABLE_USER_SITE = "--user" in sys.argv[1:] | ||
|
||
if '--version' in sys.argv: | ||
print(version) | ||
sys.exit(0) | ||
|
||
setup( | ||
name='ansi2html', | ||
version=version, | ||
description="Convert text with ANSI color codes to HTML", | ||
long_description=long_description, | ||
author='Ralph Bean', | ||
author_email='rbean@redhat.com', | ||
url='http://github.com/ralphbean/ansi2html/', | ||
license='LGPLv3+', | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: System Administrators", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Topic :: Text Processing", | ||
"Topic :: Text Processing :: Markup", | ||
"Topic :: Text Processing :: Markup :: HTML", | ||
], | ||
install_requires=requires, | ||
tests_require=[ | ||
'nose', | ||
'mock>=0.8', | ||
], | ||
test_suite='nose.collector', | ||
packages=['ansi2html'], | ||
data_files=data_files, | ||
include_package_data=True, | ||
zip_safe=False, | ||
entry_points=""" | ||
[console_scripts] | ||
ansi2html = ansi2html.converter:main | ||
""" | ||
) | ||
if __name__ == "__main__": | ||
setuptools.setup( | ||
use_scm_version={"local_scheme": "no-local-version"}, | ||
setup_requires=["setuptools_scm[toml]>=3.5.0"], | ||
) |
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