Retrieved at 2019.10.30 PM 11:00
authorpinkrabbit412 <pinkrabbit412@daum.net>
Wed, 30 Oct 2019 14:00:52 +0000 (23:00 +0900)
committerpinkrabbit412 <pinkrabbit412@daum.net>
Wed, 30 Oct 2019 14:00:52 +0000 (23:00 +0900)
원본 리포지토리 업데이트에 따른 요소 갱신.

.travis.yml
README.md
docs/api.rst
docs/index.rst
docs/running_tests.rst [new file with mode: 0644]
setup.cfg
setup.py
tests/config.py
tests/test_api.py
tox.ini

index c79c5b586395ee9604ed647c0ec1e5514e01396f..9095cf43352ee4500eb1f1b9036648a4bf991705 100644 (file)
@@ -5,26 +5,22 @@ python:
 - '2.7'
 - '3.5'
 - '3.6'
+- '3.7'
+- '3.8'
 
 matrix:
   fast_finish: true
-  include:
-    - python: 3.7
-      dist: xenial
 
 env:
   global:
-  - TWITTER_USERNAME="TweepyDev"
   - AWS_BUCKET="tweepy"
-  - USE_REPLAY=1
   - secure: TPQSFGqdl6khXqQqTZ6euROoAmFRnONAlPXD6npvTIIN+fNfnz8lvZtOEWHo2jRPLoU3FyVUhYvTynj6B2hJinulP+RKOMbQ65HCZVHrsitwl1n1QZB5HegQDOYc5q6VTTYn/r8r5tGy35U0O80y1zycTLqSJiXlkdqsSq564pI=
 
 install:
-  - pip install -r test_requirements.txt -r requirements.txt
-  - pip install coveralls
+  - pip install .[dev,test]
 
 script:
-  - nosetests -v --with-coverage -c tests/travis-tests.cfg
+  - python setup.py nosetests
 
 after_success:
   - if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then coveralls; fi
index 47c09f6e94ff0ce258a932b5af04dbbf583b2922..a176697cc78d9bd957d6cd5b7399389a21dd814e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -21,7 +21,7 @@ GitHub and install it manually:
     cd tweepy
     python setup.py install
 
-Python 2.7, 3.5, 3.6, & 3.7 are supported.
+Python 2.7, 3.5, 3.6, 3.7, & 3.8 are supported.
 
 Community
 ---------
index 244ef6ca9096a09c8ce85ae35094b6287c9c0414..6c9e9c0bc4b6e3e180511264108f4d8391094f81 100644 (file)
@@ -1126,30 +1126,6 @@ Geo Methods
                        This is only a guideline, which may not be adhered to.
 
 
-.. method:: API.reverse_geocode([lat], [long], [ip], [accuracy], \
-                                [granularity], [max_results])
-
-   Given a latitude and longitude, looks for nearby places (cities and
-   neighbourhoods) whose IDs can be specified in a call to
-   :func:`update_status` to appear as the name of the location. This call
-   provides a detailed response about the location in question; the
-   :func:`nearby_places` function should be preferred for getting a list of
-   places nearby without great detail.
-
-   :param lat: The location's latitude.
-   :param long: The location's longitude.
-   :param ip: The location's IP address. Twitter will attempt to geolocate
-              using the IP address.
-   :param accuracy: Specify the "region" in which to search, such as a number
-                    (then this is a radius in meters, but it can also take a
-                    string that is suffixed with ft to specify feet).
-                    If this is not passed in, then it is assumed to be 0m
-   :param granularity: Assumed to be `neighborhood' by default; can also be
-                       `city'.
-   :param max_results: A hint as to the maximum number of results to return.
-                       This is only a guideline, which may not be adhered to.
-
-
 .. method:: API.geo_id(id)
 
    Given *id* of a place, provide more details about that place.
index 1c83919df1c8f8770dc2136f76c3ce6348bb0060..1daa4f917fa0d526f5174acbaa41fb50a23ac791 100644 (file)
@@ -18,6 +18,7 @@ Contents:
    extended_tweets.rst
    streaming_how_to.rst
    api.rst
+   running_tests.rst
 
 Indices and tables
 ==================
diff --git a/docs/running_tests.rst b/docs/running_tests.rst
new file mode 100644 (file)
index 0000000..3131751
--- /dev/null
@@ -0,0 +1,29 @@
+.. _running_tests:
+
+*************
+Running Tests
+*************
+
+These steps outline how to run tests for Tweepy:
+
+1. Download Tweepy's source code to a directory.
+
+2. Install from the downloaded source with the ``test`` extra, e.g.
+   ``pip install .[test]``. Optionally install the ``dev`` extra as well, for
+   ``tox`` and ``coverage``, e.g. ``pip install .[dev,test]``.
+
+3. Run ``python setup.py nosetests`` or simply ``nosetests`` in the source
+   directory. With the ``dev`` extra, coverage will be shown, and ``tox`` can
+   also be run to test different Python versions.
+
+To record new cassettes, the following environment variables can be used:
+
+``TWITTER_USERNAME``
+``CONSUMER_KEY``
+``CONSUMER_SECRET``
+``ACCESS_KEY``
+``ACCESS_SECRET``
+``USE_REPLAY``
+
+Simply set ``USE_REPLAY`` to ``False`` and provide the app and account
+credentials and username.
index 2a9acf13daa95e85642ea255d3e3bd1ef8252804..5a1e4f120145cad7fa04b585bfb8fd0066c25770 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,2 +1,7 @@
 [bdist_wheel]
 universal = 1
+
+[nosetests]
+tests = tests.test_api,tests.test_cursors,tests.test_resultset,tests.test_utils
+verbosity = 2
+with-coverage = 1
index e2c36016f2b7ca04d4305d77c088bfeb2fbb963f..9491c2ce496bc2bfa018efa13406ae25ab8f9c40 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,46 +1,73 @@
 #!/usr/bin/env python
 
-# from distutils.core import setup
 import re
 from setuptools import find_packages, setup
 
-VERSIONFILE = "tweepy/__init__.py"
-ver_file = open(VERSIONFILE, "rt").read()
-VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
-mo = re.search(VSRE, ver_file, re.M)
+VERSION_FILE = "tweepy/__init__.py"
+with open(VERSION_FILE) as version_file:
+    match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
+                      version_file.read(), re.MULTILINE)
 
-if mo:
-    version = mo.group(1)
+if match:
+    version = match.group(1)
 else:
-    raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
+    raise RuntimeError("Unable to find version string in %s." % (VERSION_FILE,))
 
-setup(name="tweepy",
-      version=version,
-      description="Twitter library for python",
-      license="MIT",
-      author="Joshua Roesslein",
-      author_email="tweepy@googlegroups.com",
-      url="http://github.com/tweepy/tweepy",
-      packages=find_packages(exclude=['tests', 'examples']),
-      install_requires=[
-          "PySocks>=1.5.7",
-          "requests>=2.11.1",
-          "requests_oauthlib>=0.7.0",
-          "six>=1.10.0",
-      ],
-      keywords="twitter library",
-      python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
-      classifiers=[
-          'Development Status :: 5 - Production/Stable',
-          'Topic :: Software Development :: Libraries',
-          '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.5',
-          'Programming Language :: Python :: 3.6',
-          'Programming Language :: Python :: 3.7',
-      ],
-      zip_safe=True)
+with open("README.md") as readme_file:
+    long_description = readme_file.read()
+
+tests_require = [
+    "mock>=1.0.1",
+    "nose>=1.3.3",
+    "vcrpy>=1.10.3",
+]
+
+setup(
+    name="tweepy",
+    version=version,
+    description="Twitter library for Python",
+    long_description=long_description,
+    long_description_content_type="text/markdown",
+    license="MIT",
+    author="Joshua Roesslein",
+    author_email="tweepy@googlegroups.com",
+    url="https://www.tweepy.org/",
+    project_urls={
+        "Documentation": "https://tweepy.readthedocs.io/",
+        "Issue Tracker": "https://github.com/tweepy/tweepy/issues",
+        "Source Code": "https://github.com/tweepy/tweepy",
+    },
+    download_url="https://pypi.org/project/tweepy/",
+    packages=find_packages(exclude=["tests", "examples"]),
+    install_requires=[
+        "requests[socks]>=2.11.1",
+        "requests_oauthlib>=0.7.0",
+        "six>=1.10.0",
+    ],
+    tests_require=tests_require,
+    extras_require={
+        "dev": [
+             "coveralls>=1.8.2",
+             "tox>=2.4.0",
+         ],
+        "test": tests_require,
+    },
+    test_suite="nose.collector",
+    keywords="twitter library",
+    python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
+    classifiers=[
+        "Development Status :: 5 - Production/Stable",
+        "Topic :: Software Development :: Libraries",
+        "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.5",
+        "Programming Language :: Python :: 3.6",
+        "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
+    ],
+    zip_safe=True,
+)
index f0e487c4194e2fb0dd2557668811d668b33d3aec..0fcea9233d39f6906274d8bc1ed889e00daea7b3 100644 (file)
@@ -12,7 +12,7 @@ oauth_consumer_key = os.environ.get('CONSUMER_KEY', '')
 oauth_consumer_secret = os.environ.get('CONSUMER_SECRET', '')
 oauth_token = os.environ.get('ACCESS_KEY', '')
 oauth_token_secret = os.environ.get('ACCESS_SECRET', '')
-use_replay = os.environ.get('USE_REPLAY', False)
+use_replay = os.environ.get('USE_REPLAY', True)
 
 
 tape = vcr.VCR(
index 05d44a442c6301bc91b15a9d8e31e65b52b38450..72a4c0e10c48f182fa1500a9798d003862112ae6 100644 (file)
@@ -5,8 +5,6 @@ import time
 import unittest
 from ast import literal_eval
 
-from nose import SkipTest
-
 from .config import tape, TweepyTestCase, use_replay, username
 from tweepy import API, FileCache, Friendship, MemoryCache
 from tweepy.parsers import Parser
@@ -74,8 +72,7 @@ class TweepyAPITests(TweepyTestCase):
         self.api.retweets_of_me()
 
     def testretweet(self):
-        # TODO(josh): Need a way to get random tweets to retweet.
-        raise SkipTest()
+        self.skipTest('Missing method to retrieve random Tweet to Retweet')
 
     @tape.use_cassette('testretweets.json')
     def testretweets(self):
diff --git a/tox.ini b/tox.ini
index 26a0e8c390cfa4bc0e14d8ae49001e514f628ad1..29e99f64c2f77703565ed4b4e7c37abbe2d2d794 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -4,17 +4,8 @@
 # and then run "tox" from this directory.
 
 [tox]
-envlist = py27, py35, py36, py37
-
-[base]
-deps =
-    mock==1.0.1
-    nose==1.3.3
-    vcrpy==1.10.3
+envlist = py27, py35, py36, py37, py38
 
 [testenv]
-commands = nosetests -v tests.test_api tests.test_cursors tests.test_resultset tests.test_utils
-deps =
-    {[base]deps}
-setenv =
-    USE_REPLAY=1
+commands = python setup.py nosetests
+extras = test