Merge branch 'remove-tox'

This commit is contained in:
Eriks K 2020-12-17 14:07:46 +02:00
commit fccd0134b5
13 changed files with 21 additions and 57 deletions

1
.gitignore vendored
View File

@ -37,7 +37,6 @@ pip-delete-this-directory.txt
# Unit test / coverage reports # Unit test / coverage reports
htmlcov/ htmlcov/
.tox/
.coverage .coverage
.coverage.* .coverage.*
.cache .cache

View File

@ -1,14 +0,0 @@
# Config file for automatic testing at travis-ci.org
language: python
python:
- 3.8
- 3.7
# Command to install dependencies, e.g. pip install -r requirements_dev.txt --use-mirrors
install: pip install -U tox-travis
# Command to run tests, e.g. python setup.py test
script: tox

View File

@ -70,14 +70,14 @@ Ready to contribute? Here's how to set up `erepublik` for local development.
Now you can make your changes locally. Now you can make your changes locally.
5. When you're done making changes, check that your changes pass flake8 and the 5. When you're done making changes, check that your changes pass flake8, isort and the
tests, including testing other Python versions with tox:: tests::
$ flake8 erepublik tests $ flake8 erepublik tests
$ python setup.py test or py.test $ isort erepublik
$ tox $ python setup.py test
To get flake8 and tox, just pip install them into your virtualenv. To get flake8 and isort, just pip install them into your virtualenv.
6. Commit your changes and push your branch to GitHub:: 6. Commit your changes and push your branch to GitHub::

View File

@ -47,7 +47,6 @@ clean-pyc: ## remove Python file artifacts
rm -rf log/ rm -rf log/
clean-test: ## remove test and coverage artifacts clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage rm -f .coverage
rm -fr htmlcov/ rm -fr htmlcov/
rm -fr .pytest_cache rm -fr .pytest_cache
@ -58,9 +57,6 @@ lint: ## check style with flake8
test: ## run tests quickly with the default Python test: ## run tests quickly with the default Python
python setup.py test python setup.py test
test-all: ## run tests on every Python version with tox
tox
coverage: ## check code coverage quickly with the default Python coverage: ## check code coverage quickly with the default Python
coverage run --source erepublik setup.py test coverage run --source erepublik setup.py test
coverage report -m coverage report -m
@ -80,6 +76,7 @@ servedocs: docs ## compile the docs watching for changes
release: dist ## package and upload a release release: dist ## package and upload a release
twine upload dist/* twine upload dist/*
clean
dist: clean ## builds source and wheel package dist: clean ## builds source and wheel package
python setup.py sdist python setup.py sdist

View File

@ -6,7 +6,7 @@ __author__ = """Eriks Karls"""
__email__ = 'eriks@72.lv' __email__ = 'eriks@72.lv'
__version__ = '0.23.3.2' __version__ = '0.23.3.2'
from erepublik import classes, utils, constants from erepublik import classes, constants, utils
from erepublik.citizen import Citizen from erepublik.citizen import Citizen
__all__ = ["classes", "utils", "Citizen", 'constants'] __all__ = ["classes", "utils", "Citizen", 'constants']

View File

@ -11,7 +11,7 @@ from typing import Any, Dict, List, NoReturn, Optional, Set, Tuple, Union
from requests import HTTPError, RequestException, Response from requests import HTTPError, RequestException, Response
from . import utils, classes, access_points, constants from . import access_points, classes, constants, utils
from .classes import OfferItem from .classes import OfferItem

View File

@ -3,11 +3,11 @@ import hashlib
import threading import threading
import weakref import weakref
from decimal import Decimal from decimal import Decimal
from typing import Any, Dict, List, NamedTuple, Tuple, Union, NoReturn, Generator, Iterable from typing import Any, Dict, Generator, Iterable, List, NamedTuple, NoReturn, Tuple, Union
from requests import Response, Session, post from requests import Response, Session, post
from . import utils, constants from . import constants, utils
__all__ = ['Battle', 'BattleDivision', 'BattleSide', 'Company', 'Config', 'Details', 'Energy', 'ErepublikException', __all__ = ['Battle', 'BattleDivision', 'BattleSide', 'Company', 'Config', 'Details', 'Energy', 'ErepublikException',
'ErepublikNetworkException', 'EnergyToFight', 'ErepublikNetworkException', 'EnergyToFight',

View File

@ -10,7 +10,7 @@ import unicodedata
import warnings import warnings
from decimal import Decimal from decimal import Decimal
from pathlib import Path from pathlib import Path
from typing import Any, List, Optional, Union, Dict from typing import Any, Dict, List, Optional, Union
import requests import requests
@ -158,6 +158,7 @@ def write_file(filename: str, content: str) -> int:
def write_request(response: requests.Response, is_error: bool = False): def write_request(response: requests.Response, is_error: bool = False):
from erepublik import Citizen from erepublik import Citizen
# Remove GET args from url name # Remove GET args from url name
url = response.url url = response.url
last_index = url.index("?") if "?" in url else len(response.url) last_index = url.index("?") if "?" in url else len(response.url)

View File

@ -1,6 +1,6 @@
from datetime import timedelta from datetime import timedelta
from erepublik import Citizen, utils, constants from erepublik import Citizen, constants, utils
CONFIG = { CONFIG = {
'email': 'player@email.com', 'email': 'player@email.com',

View File

@ -4,16 +4,15 @@ edx-sphinx-theme==1.5.0
flake8==3.8.4 flake8==3.8.4
ipython>=7.19.0 ipython>=7.19.0
isort==5.6.4 isort==5.6.4
pip==20.3.1 pip==20.3.3
PyInstaller==4.1 PyInstaller==4.1
pytz==2020.4 pytz==2020.4
pytest==6.1.2 pytest==6.2.1
responses==0.12.1 responses==0.12.1
setuptools==51.0.0 setuptools==51.0.0
Sphinx==3.3.1 Sphinx==3.3.1
requests==2.25.0 requests>=2.24.0,<2.26.0
PySocks==1.7.1 PySocks==1.7.1
tox==3.20.1
twine==3.2.0 twine==3.2.0
watchdog==1.0.0 wheel==0.36.2
wheel==0.36.1 pur==5.3.0

View File

@ -18,13 +18,13 @@ replace = __version__ = '{new_version}'
universal = 1 universal = 1
[flake8] [flake8]
exclude = docs,.tox,.git,log,debug,venv exclude = docs,.git,log,debug,venv
max-line-length = 120 max-line-length = 120
ignore = D100,D101,D102,D103 ignore = D100,D101,D102,D103
[pycodestyle] [pycodestyle]
max-line-length = 120 max-line-length = 120
exclude = .tox,.git,log,debug,venv, build exclude = .git,log,debug,venv, build
[mypy] [mypy]
python_version = 3.7 python_version = 3.7

View File

@ -13,7 +13,7 @@ with open('HISTORY.rst') as history_file:
requirements = [ requirements = [
'pytz==2020.4', 'pytz==2020.4',
'requests==2.25.0', 'requests>=2.24.0,<2.26.0',
'PySocks==1.7.1' 'PySocks==1.7.1'
] ]

18
tox.ini
View File

@ -1,18 +0,0 @@
[tox]
envlist = py37, py38, flake8
[travis]
python =
3.7: py37
3.8: py38
[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 erepublik_script
[testenv]
setenv =
PYTHONPATH = {toxinidir}
commands = python setup.py test