-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Poetry and reinstate
setup.py
- Loading branch information
Showing
10 changed files
with
182 additions
and
93 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
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,2 @@ | ||
include .coveragerc .flake8 CHANGELOG.md LICENSE LONG_DESCRIPTION.rst README.md VERSION pytest.ini tox.ini | ||
recursive-include tests *.py |
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,17 +1,34 @@ | ||
test: | ||
poetry run tox -p auto | ||
VENV_NAME?=venv | ||
|
||
ci: | ||
poetry run pytest --cov=stripe | ||
venv: $(VENV_NAME)/bin/activate | ||
|
||
coveralls: | ||
poetry run coveralls | ||
$(VENV_NAME)/bin/activate: setup.py | ||
pip install --upgrade pip virtualenv | ||
@test -d $(VENV_NAME) || python -m virtualenv --clear $(VENV_NAME) | ||
${VENV_NAME}/bin/python -m pip install -U pip tox | ||
${VENV_NAME}/bin/python -m pip install -e . | ||
@touch $(VENV_NAME)/bin/activate | ||
|
||
fmt: | ||
poetry run tox -e fmt | ||
test: venv | ||
@${VENV_NAME}/bin/tox -p auto $(TOX_ARGS) | ||
|
||
fmtcheck: | ||
poetry run tox -e fmt -- --check --verbose | ||
ci: venv | ||
@${VENV_NAME}/bin/python setup.py test -a "-n auto --cov=stripe" | ||
|
||
lint: | ||
poetry run tox -e lint | ||
coveralls: venv | ||
@${VENV_NAME}/bin/pip install --upgrade coveralls | ||
@${VENV_NAME}/bin/coveralls | ||
|
||
fmt: venv | ||
@${VENV_NAME}/bin/tox -e fmt | ||
|
||
fmtcheck: venv | ||
@${VENV_NAME}/bin/tox -e fmt -- --check --verbose | ||
|
||
lint: venv | ||
@${VENV_NAME}/bin/tox -e lint | ||
|
||
clean: | ||
@rm -rf $(VENV_NAME) build/ dist/ | ||
|
||
.PHONY: venv test ci coveralls fmt fmtcheck lint clean |
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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
[build-system] | ||
requires = ["poetry>=0.12"] | ||
build-backend = "poetry.masonry.api" | ||
|
||
[tool.black] | ||
line-length=79 | ||
exclude = ''' | ||
|
@@ -13,58 +9,7 @@ exclude = ''' | |
| _build/ | ||
| build/ | ||
| dist/ | ||
| venv/ | ||
| stripe/six.py | ||
) | ||
''' | ||
|
||
[tool.poetry] | ||
name = "stripe" | ||
version = "2.29.3" | ||
description = "Python bindings for the Stripe API" | ||
|
||
license = "MIT" | ||
|
||
authors = [ | ||
"Stripe <[email protected]>" | ||
] | ||
|
||
readme = 'LONG_DESCRIPTION.rst' | ||
|
||
repository = "https://github.com/stripe/stripe-python" | ||
homepage = "https://github.com/stripe/stripe-python" | ||
documentation = "https://stripe.com/docs/api?lang=python" | ||
|
||
keywords = ['stripe', 'api', 'payments'] | ||
|
||
include = [ | ||
"data/ca-certificates.crt", | ||
"stripe/**/*.py", | ||
"tests/**/*.py", | ||
".coveragerc", | ||
".flake8", | ||
"CHANGELOG.md", | ||
"LICENSE", | ||
"LONG_DESCRIPTION.rst", | ||
"README.md", | ||
"VERSION", | ||
"pyproject.toml", | ||
"pytest.ini", | ||
"tox.ini" | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "~2.7 || ^3.4" | ||
requests = [ | ||
{ version = "^2.20", python = "~2.7", extras = [ "security" ] }, | ||
{ version = "^2.20", python = "^3.4" } | ||
] | ||
toml = "^0.9" | ||
|
||
[tool.poetry.dev-dependencies] | ||
coveralls = "^1.7" | ||
flake8 = "^3.7" | ||
pytest = "^4.4" | ||
pytest-cov = "^2.6" | ||
pytest-mock = "^1.10" | ||
pytest-xdist = "^1.28" | ||
tox = "^3.9" |
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,5 @@ | ||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[metadata] | ||
license_file = LICENSE |
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,88 @@ | ||
import os | ||
import sys | ||
from codecs import open | ||
from setuptools import setup, find_packages | ||
from setuptools.command.test import test as TestCommand | ||
|
||
|
||
class PyTest(TestCommand): | ||
user_options = [("pytest-args=", "a", "Arguments to pass to pytest")] | ||
|
||
def initialize_options(self): | ||
TestCommand.initialize_options(self) | ||
self.pytest_args = "-n auto" | ||
|
||
def run_tests(self): | ||
import shlex | ||
|
||
# import here, cause outside the eggs aren't loaded | ||
import pytest | ||
|
||
errno = pytest.main(shlex.split(self.pytest_args)) | ||
sys.exit(errno) | ||
|
||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
os.chdir(here) | ||
|
||
with open( | ||
os.path.join(here, "LONG_DESCRIPTION.rst"), "r", encoding="utf-8" | ||
) as fp: | ||
long_description = fp.read() | ||
|
||
version_contents = {} | ||
with open(os.path.join(here, "stripe", "version.py"), encoding="utf-8") as f: | ||
exec(f.read(), version_contents) | ||
|
||
setup( | ||
name="stripe", | ||
version=version_contents["VERSION"], | ||
description="Python bindings for the Stripe API", | ||
long_description=long_description, | ||
long_description_content_type="text/x-rst", | ||
author="Stripe", | ||
author_email="[email protected]", | ||
url="https://github.com/stripe/stripe-python", | ||
license="MIT", | ||
keywords="stripe api payments", | ||
packages=find_packages(exclude=["tests", "tests.*"]), | ||
package_data={"stripe": ["data/ca-certificates.crt"]}, | ||
zip_safe=False, | ||
install_requires=[ | ||
'requests >= 2.20; python_version >= "3.0"', | ||
'requests[security] >= 2.20; python_version < "3.0"', | ||
], | ||
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", | ||
tests_require=[ | ||
"pytest >= 4.6.2, < 4.7", | ||
"pytest-mock >= 1.10.4", | ||
"pytest-xdist >= 1.28.0", | ||
"pytest-cov >= 2.7.1", | ||
# coverage 5.0 pre-releases don't work, and setuptools doesn't ignore | ||
# pre-releases (cf. https://github.com/pypa/setuptools/issues/855) | ||
"coverage >= 4.5.3, < 5", | ||
], | ||
cmdclass={"test": PyTest}, | ||
project_urls={ | ||
"Bug Tracker": "https://github.com/stripe/stripe-python/issues", | ||
"Documentation": "https://stripe.com/docs/api/python", | ||
"Source Code": "https://github.com/stripe/stripe-python", | ||
}, | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.4", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
], | ||
) |
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 |
---|---|---|
|
@@ -12,7 +12,6 @@ envlist = py27, | |
pypy, | ||
pypy3, | ||
lint | ||
isolated_build = true | ||
skip_missing_interpreters = true | ||
|
||
[testenv] | ||
|