Add packaging support

This commit is contained in:
Gabe Appleton 2022-09-20 17:22:55 -04:00
parent 2372d1bff8
commit a936698245
GPG Key ID: AF65A9CA0FF7FD69
8 changed files with 32 additions and 25 deletions

8
.bumpversion.cfg Normal file
View File

@ -0,0 +1,8 @@
[bumpversion]
current_version = 0.5.0.12
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.(?P<build>\d+)
serialize = {major}.{minor}.{patch}.{build}
[bumpversion:file:setup.cfg]
[bumpversion:file:src/__init__.py]

View File

@ -102,14 +102,14 @@ quiet_daemon:
.PHONY: build
# (TODO) Build a package
build: dependencies clean LICENSE
@$(PY) setup.py bdist_wheel --universal
@$(PY) setup.py sdist
@$(PIP) install build
@$(PY) -m build
.PHONY: clean
# Clean up after a build
clean:
@mkdir -p build dist
@rm -r build dist
@rm -r build dist *.egg-info
.PHONY: publish
# (TODO) Publish new version to pypi

3
pyproject.toml Normal file
View File

@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

View File

@ -1,25 +1,20 @@
[bumpversion]
current_version = 0.5.0.7
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.(?P<build>\d+)
serialize = {major}.{minor}.{patch}.{build}
[metadata]
name = ManifoldMarketManager
author = Olivia Appleton
author_email = Liv@OliviaAppleton.com
version = attr: ManifoldMarketManager.VERSION
version = 0.5.0.12
description = Tools and market management for manifold.markets
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/gappleto97/ManifoldMarketManager
license = AGPLv3
classifiers =
classifiers =
Development Status :: 3 - Alpha
Environment :: Console
Intended Audience :: Developers
Intended Audience :: Financial and Insurance Industry
Intended Audience :: Science/Research
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
License :: OSI Approved :: GNU Affero General Public License v3 (AGPLv3)
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
@ -33,18 +28,19 @@ classifiers =
Typing :: Typed
[options]
package_dir =
package_dir =
=src
packages = find:
install_requires =
install_requires =
requests
python_requires = >=3.5
include_package_data = True
[options.packages.find]
where = src
[options.extras_require]
tests =
tests =
flake8 < 5
pytest
pytest-benchmark
@ -53,17 +49,13 @@ tests =
pytest-isort
pytest-mypy
pytest-xdist
github =
github =
github3.py
telegram =
telegram =
python-telegram-bot>=20.0a4
all =
all =
ManifoldMarketManager[tests,github,telegram]
[bumpversion:file:setup.cfg]
[bumpversion:file:src/__init__.py]
[flake8]
max-line-length = 120
@ -79,5 +71,5 @@ warn_unused_ignores = True
line_length = 120
[tool:pytest]
markers =
markers =
slow: tests that run slowly

4
setup.py Normal file
View File

@ -0,0 +1,4 @@
from setuptools import setup
if __name__ == '__main__':
setup()

BIN
src.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 318 KiB

View File

@ -60,7 +60,7 @@ class Rule(ABC, DictDeserializable):
if val == "CANCEL":
ret += "CANCEL)\n"
return ret
if market.market.outcomeType == "BINARY":
if isinstance(val, bool) or market.market.outcomeType == "BINARY":
if val is True or val == 100:
ret += "YES)\n"
elif not val:
@ -90,7 +90,7 @@ register_converter("Rule", loads)
register_adapter(market.Market, dumps)
register_converter("Market", loads)
VERSION = "0.5.0.7"
VERSION = "0.5.0.12"
__version_info__ = tuple(int(x) for x in VERSION.split('.'))
__all__ = [
"__version_info__", "get_client", "market", "require_env", "rule", "util", "Market", "DoResolveRule",
@ -120,7 +120,7 @@ if getenv("DEBUG"):
sys.excepthook = info
# dynamically load optional plugins where able to
exempt = ('__init__', '__main__', '__pycache__', 'application', 'test', 'PyManifold', *__all__)
exempt = ('__init__', '__main__', '__pycache__', '__version__', 'application', 'test', 'PyManifold', *__all__)
for entry in Path(__file__).parent.iterdir():
name = entry.name.rstrip(".py")
if name.startswith('.') or name in exempt: