Skip to content

Commit

Permalink
Move package metadata to setup.cfg
Browse files Browse the repository at this point in the history
Note the setup() includes only dynamically generated options.

GitHub seems to have recently fixed their dependency scanning to look
at setup.cfg (dependabot/dependabot-core#3423).
Possibly not deployed to GitHub yet.
  • Loading branch information
randomir committed Jun 25, 2021
1 parent d640696 commit cd1db60
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 46 deletions.
38 changes: 38 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[metadata]
name = dwave-tabu
version = attr: tabu.__version__
description = Optimized Tabu solver for QUBOs
long_description = file: README.rst
long_description_content_type = text/x-rst
license = Apache 2.0
license_file = LICENSE
author = D-Wave Systems Inc.
author_email = [email protected]
url = https://github.com/dwavesystems/dwave-tabu
project_urls =
Documentation = https://docs.ocean.dwavesys.com/en/stable/docs_tabu/sdk_index.html
Issue Tracker = https://github.com/dwavesystems/dwave-tabu/issues/
Source Code = https://github.com/dwavesystems/dwave-tabu/
classifiers =
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
Development Status :: 4 - Beta
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: Implementation :: CPython

[options]
packages = tabu
zip_safe = false
include_package_data = true
python_requires = >=3.6
install_requires =
numpy>=1.16.0,<2.0.0
dimod>=0.9.0,<0.10.0

[aliases]
dists = clean --all sdist bdist_wheel
41 changes: 0 additions & 41 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from Cython.Build import cythonize
Expand Down Expand Up @@ -47,52 +45,13 @@ def build_extensions(self):
super().build_extensions()


# Load package info, without importing the package
basedir = os.path.dirname(os.path.abspath(__file__))
package_info_path = os.path.join(basedir, "tabu", "package_info.py")
package_info = {}
with open(package_info_path, encoding='utf-8') as f:
exec(f.read(), package_info)

packages = ['tabu']

# Package requirements, minimal pinning
install_requires = ['numpy>=1.16.0', 'dimod>=0.9.0']

extensions = [Extension(
name='tabu.tabu_search',
sources=['tabu/tabu_search.pyx', 'tabu/src/utils.cpp', 'tabu/src/bqp.cpp'],
include_dirs=[numpy.get_include()]
)]


classifiers = [
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Development Status :: 3 - Alpha',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
]

python_requires = '>=3.6'

setup(
name=package_info['__packagename__'],
version=package_info['__version__'],
author=package_info['__author__'],
author_email=package_info['__authoremail__'],
description=package_info['__description__'],
long_description=open('README.rst', encoding='utf-8').read(),
url=package_info['__url__'],
license=package_info['__license__'],
classifiers=classifiers,
cmdclass={'build_ext': build_ext_with_args},
ext_modules=cythonize(extensions),
packages=packages,
python_requires=python_requires,
install_requires=install_requires,
zip_safe=False,
)
3 changes: 3 additions & 0 deletions tabu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__package_name__ = 'dwave-tabu'
__version__ = '0.4.0'

__all__ = ['TabuSearch', 'TabuSampler']

from tabu.tabu_search import TabuSearch
Expand Down
8 changes: 3 additions & 5 deletions tabu/package_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__packagename__ = 'dwave-tabu'
__title__ = 'D-Wave Tabu'
__version__ = '0.4.0'
from tabu import __version__, __package_name__

__author__ = 'D-Wave Systems Inc.'
__authoremail__ = '[email protected]'
__author_email__ = '[email protected]'
__description__ = 'Optimized Tabu solver for QUBOs'
__url__ = 'https://github.com/dwavesystems/dwave-tabu'
__license__ = 'Apache 2.0'
__copyright__ = '2018, D-Wave Systems Inc.'

0 comments on commit cd1db60

Please sign in to comment.