Skip to content

Commit 4d02dbd

Browse files
committed
Move package metadata to setup.cfg
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.
1 parent 50013b7 commit 4d02dbd

5 files changed

Lines changed: 56 additions & 53 deletions

File tree

greedy/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
__version__ = '0.1.2'
16+
1517
from greedy.sampler import *
1618
import greedy.sampler
1719

1820
from greedy.composite import *
1921
import greedy.composite
2022

21-
from greedy.package_info import __version__
2223
import greedy.package_info

greedy/package_info.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from greedy import __version__
16+
17+
# keep in sync with setup.cfg
1518
__package_name__ = 'dwave-greedy'
1619
__title__ = 'D-Wave Greedy'
17-
__version__ = '0.1.2'
1820
__author__ = 'D-Wave Systems Inc.'
19-
__author_email__ = 'radomir@dwavesys.com'
21+
__author_email__ = 'tools@dwavesys.com'
2022
__description__ = 'Ocean-compatible collection of greedy/brute-force solvers/samplers'
2123
__url__ = 'https://github.com/dwavesystems/dwave-greedy'
2224
__license__ = 'Apache 2.0'

setup.cfg

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
11
[metadata]
2-
license-file = LICENSE
3-
description-file = README.rst
2+
name = dwave-greedy
3+
version = attr: greedy.__version__
4+
description = Ocean-compatible collection of greedy/brute-force solvers/samplers
5+
long_description = file: README.rst
6+
long_description_content_type = text/x-rst
7+
license = Apache 2.0
8+
license_file = LICENSE
9+
copyright = 2019, D-Wave Systems Inc.
10+
author = D-Wave Systems Inc.
11+
author_email = tools@dwavesys.com
12+
url = https://github.com/dwavesystems/dwave-greedy
13+
project_urls =
14+
Documentation = https://docs.ocean.dwavesys.com/en/stable/docs_greedy/sdk_index.html
15+
Issue Tracker = https://github.com/dwavesystems/dwave-greedy/issues/
16+
Source Code = https://github.com/dwavesystems/dwave-greedy/
17+
classifiers =
18+
License :: OSI Approved :: Apache Software License
19+
Operating System :: OS Independent
20+
Development Status :: 4 - Beta
21+
Programming Language :: Python :: 3
22+
Programming Language :: Python :: 3 :: Only
23+
Programming Language :: Python :: 3.6
24+
Programming Language :: Python :: 3.7
25+
Programming Language :: Python :: 3.8
26+
Programming Language :: Python :: 3.9
27+
Programming Language :: Python :: Implementation :: CPython
28+
29+
[options]
30+
packages = greedy
31+
zip_safe = false
32+
include_package_data = true
33+
python_requires = >=3.6
34+
install_requires =
35+
numpy>=1.16.0,<2.0.0
36+
dimod>=0.9.2,<0.10.0
37+
38+
# keep in sync with {tests,docs}/requirements.txt
39+
[options.extras_require]
40+
test =
41+
coverage
42+
codecov
43+
parameterized
44+
dwave-system>=1.0.0
45+
docs =
46+
sphinx>=4.0.0,<5.0.0
47+
sphinx_rtd_theme
48+
recommonmark
49+
50+
[aliases]
51+
dists = clean --all sdist bdist_wheel

setup.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import os
16-
1715
from setuptools import setup, Extension
1816
from setuptools.command.build_ext import build_ext
1917
from Cython.Build import cythonize
@@ -39,7 +37,6 @@ def build_extensions(self):
3937
compile_args = self.extra_compile_args[compiler]
4038
for ext in self.extensions:
4139
ext.extra_compile_args = compile_args
42-
print(dir(ext))
4340

4441
link_args = self.extra_link_args[compiler]
4542
for ext in self.extensions:
@@ -48,57 +45,13 @@ def build_extensions(self):
4845
super().build_extensions()
4946

5047

51-
# Load package info, without importing the package
52-
basedir = os.path.dirname(os.path.abspath(__file__))
53-
package_info_path = os.path.join(basedir, "greedy", "package_info.py")
54-
package_info = {}
55-
with open(package_info_path, encoding='utf-8') as f:
56-
exec(f.read(), package_info)
57-
58-
packages = ['greedy']
59-
60-
# Package requirements, minimal pinning
61-
install_requires = ['numpy>=1.16.0,<2.0.0', 'dimod>=0.9.2,<0.10.0']
62-
63-
# Package extras requirements
64-
extras_require = {
65-
'test': ['coverage', 'mock', 'parameterized', 'dwave-system>=1.0.0'],
66-
}
67-
6848
extensions = [Extension(
6949
name='greedy.descent',
7050
sources=['greedy/descent.pyx'],
7151
include_dirs=[numpy.get_include()]
7252
)]
7353

74-
classifiers = [
75-
'License :: OSI Approved :: Apache Software License',
76-
'Operating System :: OS Independent',
77-
'Development Status :: 3 - Alpha',
78-
'Programming Language :: Python :: 3',
79-
'Programming Language :: Python :: 3.6',
80-
'Programming Language :: Python :: 3.7',
81-
'Programming Language :: Python :: 3.8',
82-
'Programming Language :: Python :: 3.9',
83-
]
84-
85-
python_requires = '>=3.6'
86-
8754
setup(
88-
name=package_info['__package_name__'],
89-
version=package_info['__version__'],
90-
author=package_info['__author__'],
91-
author_email=package_info['__author_email__'],
92-
description=package_info['__description__'],
93-
long_description=open('README.rst', encoding='utf-8').read(),
94-
url=package_info['__url__'],
95-
license=package_info['__license__'],
96-
packages=packages,
97-
python_requires=python_requires,
98-
install_requires=install_requires,
99-
extras_require=extras_require,
10055
ext_modules=cythonize(extensions),
10156
cmdclass={'build_ext': build_ext_with_args},
102-
classifiers=classifiers,
103-
zip_safe=False,
10457
)

tests/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
mock
21
coverage
32
codecov
43
parameterized

0 commit comments

Comments
 (0)