2017-11-20 03:24:08 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2021-01-01 17:14:24 +00:00
|
|
|
# Copyright 2009-2021 Joshua Bronson. All Rights Reserved.
|
2017-11-20 03:24:08 +00:00
|
|
|
#
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2017-03-17 16:16:45 +00:00
|
|
|
|
2018-04-19 08:22:07 +00:00
|
|
|
"""A setuptools-based setup module.
|
2017-03-17 16:16:45 +00:00
|
|
|
|
2018-04-19 08:22:07 +00:00
|
|
|
Ref: https://github.com/pypa/sampleproject/blob/master/setup.py
|
|
|
|
"""
|
|
|
|
|
2019-11-13 02:39:04 +00:00
|
|
|
import sys
|
2018-04-19 08:22:07 +00:00
|
|
|
from os.path import abspath, dirname, join
|
2019-11-13 02:39:04 +00:00
|
|
|
from warnings import warn
|
2017-03-17 16:16:45 +00:00
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
from setuptools import setup
|
2017-03-17 16:16:45 +00:00
|
|
|
|
2015-03-22 18:21:15 +00:00
|
|
|
|
2019-11-13 02:39:04 +00:00
|
|
|
PY2_ERR = """
|
|
|
|
This version of bidict does not support Python 2.
|
2020-11-28 15:09:30 +00:00
|
|
|
Either use bidict 0.18.4,
|
2019-11-13 02:39:04 +00:00
|
|
|
the last release with Python 2 support,
|
|
|
|
or use Python 3.
|
|
|
|
|
|
|
|
Also ensure you are using pip >= 9.0.1 to install bidict.
|
|
|
|
|
|
|
|
See python3statement.org for more info.
|
|
|
|
"""
|
|
|
|
|
|
|
|
if sys.version_info < (3,):
|
|
|
|
sys.exit(PY2_ERR)
|
2020-07-30 13:31:03 +00:00
|
|
|
elif sys.version_info < (3, 6):
|
|
|
|
warn('This version of bidict is untested on Python < 3.6 and may not work.')
|
2019-11-13 02:39:04 +00:00
|
|
|
|
2020-08-01 18:26:08 +00:00
|
|
|
from importlib.util import module_from_spec, spec_from_file_location
|
2019-11-13 02:39:04 +00:00
|
|
|
|
2018-04-19 08:22:07 +00:00
|
|
|
CWD = abspath(dirname(__file__))
|
|
|
|
|
|
|
|
# Get bidict's package metadata from ./bidict/metadata.py.
|
|
|
|
METADATA_PATH = join(CWD, 'bidict', 'metadata.py')
|
2020-07-30 13:31:03 +00:00
|
|
|
SPEC = spec_from_file_location('metadata', METADATA_PATH)
|
|
|
|
METADATA = module_from_spec(SPEC)
|
2020-08-01 18:26:08 +00:00
|
|
|
SPEC.loader.exec_module(METADATA) # type: ignore
|
2018-04-19 08:22:07 +00:00
|
|
|
|
2020-11-28 15:09:30 +00:00
|
|
|
with open(join(CWD, 'README.rst'), encoding='utf-8') as f:
|
2018-04-19 08:22:07 +00:00
|
|
|
LONG_DESCRIPTION = f.read()
|
|
|
|
|
2014-09-23 14:08:21 +00:00
|
|
|
setup(
|
|
|
|
name='bidict',
|
2018-02-25 23:44:21 +00:00
|
|
|
use_scm_version={
|
|
|
|
'version_scheme': 'guess-next-dev',
|
|
|
|
'local_scheme': 'dirty-tag',
|
|
|
|
'write_to': 'bidict/_version.py',
|
2020-11-28 15:09:30 +00:00
|
|
|
'parentdir_prefix_version': 'bidict-',
|
2018-02-25 23:44:21 +00:00
|
|
|
},
|
2020-08-01 18:26:08 +00:00
|
|
|
author=METADATA.__author__, # type: ignore
|
|
|
|
author_email=METADATA.__email__, # type: ignore
|
|
|
|
description=METADATA.__description__, # type: ignore
|
2017-11-21 03:27:26 +00:00
|
|
|
long_description=LONG_DESCRIPTION,
|
2020-08-01 18:26:08 +00:00
|
|
|
long_description_content_type='text/x-rst',
|
|
|
|
keywords=METADATA.__keywords__, # type: ignore
|
|
|
|
url=METADATA.__url__, # type: ignore
|
|
|
|
license=METADATA.__license__, # type: ignore
|
2015-05-30 20:26:26 +00:00
|
|
|
packages=['bidict'],
|
2020-09-08 00:00:16 +00:00
|
|
|
include_package_data=True,
|
2017-11-20 03:24:08 +00:00
|
|
|
zip_safe=False, # Don't zip. (We're zip-safe but prefer not to.)
|
2020-08-01 18:26:08 +00:00
|
|
|
python_requires='>=3.6',
|
2014-09-23 14:08:21 +00:00
|
|
|
classifiers=[
|
|
|
|
'Development Status :: 4 - Beta',
|
|
|
|
'Intended Audience :: Developers',
|
2017-03-15 20:43:05 +00:00
|
|
|
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
|
2014-09-23 14:08:21 +00:00
|
|
|
'Operating System :: OS Independent',
|
2019-11-04 02:54:52 +00:00
|
|
|
'Programming Language :: Python :: 3 :: Only',
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
'Programming Language :: Python :: 3.6',
|
2017-11-16 20:44:51 +00:00
|
|
|
'Programming Language :: Python :: 3.7',
|
2019-10-20 19:51:01 +00:00
|
|
|
'Programming Language :: Python :: 3.8',
|
2020-12-19 14:58:02 +00:00
|
|
|
'Programming Language :: Python :: 3.9',
|
2014-09-30 15:54:30 +00:00
|
|
|
'Programming Language :: Python :: Implementation :: CPython',
|
|
|
|
'Programming Language :: Python :: Implementation :: PyPy',
|
2014-09-23 14:08:21 +00:00
|
|
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
2020-12-19 14:58:02 +00:00
|
|
|
'Typing :: Typed',
|
2017-11-20 03:24:08 +00:00
|
|
|
],
|
2020-11-28 15:09:30 +00:00
|
|
|
setup_requires=['setuptools_scm'],
|
2015-03-22 18:21:15 +00:00
|
|
|
)
|