Compare commits

..

4 Commits

Author SHA1 Message Date
954e9d576b Bump version: 0.27.1 → 0.27.2 2021-11-02 18:44:50 +02:00
47ec6c03df Updated requirements 2021-11-02 18:44:40 +02:00
44360bd143 erep.lv url update 2021-11-02 18:32:13 +02:00
3e0caae041 Doc update 2021-10-23 16:55:26 +03:00
14 changed files with 65 additions and 74 deletions

View File

@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v2

View File

@ -58,10 +58,10 @@ Ready to contribute? Here's how to set up `erepublik` for local development.
$ git clone git@github.com:your_name_here/erepublik.git
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
3. This is how you set up your fork for local development::
$ mkvirtualenv erepublik
$ cd erepublik/
$ python3 -m venv venv
$ python setup.py develop
4. Create a branch for local development::
@ -73,8 +73,7 @@ Ready to contribute? Here's how to set up `erepublik` for local development.
5. When you're done making changes, check that your changes pass flake8, isort and the
tests::
$ flake8 erepublik tests
$ isort erepublik
$ make lint
$ python setup.py test
To get flake8 and isort, just pip install them into your virtualenv.
@ -115,8 +114,6 @@ A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.rst).
Then run::
$ bumpversion patch # possible: major / minor / patch
$ bumpversion patch # possible: major / minor / patch / dev
$ git push
$ git push --tags
Travis will then deploy to PyPI if tests pass.

View File

@ -25,6 +25,7 @@ sys.path.insert(0, os.path.abspath(".."))
import erepublik
import edx_theme
import datetime
# -- General configuration ---------------------------------------------
@ -50,7 +51,7 @@ master_doc = "index"
# General information about the project.
project = "eRepublik script"
copyright = "2019, Eriks Karls"
copyright = "2017-%i, Eriks Karls" % datetime.date.today().year
author = "Eriks Karls"
# The version info for the project you're documenting, acts as replacement

View File

@ -44,14 +44,6 @@ erepublik.utils module
:undoc-members:
:show-inheritance:
erepublik.ws module
-------------------
.. automodule:: erepublik.ws
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------

View File

@ -8,12 +8,10 @@
<meta name="generator" content="Jekyll v4.0.1">
<title>eBot configuration</title>
<!-- CSS only -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<!-- JS, Popper.js, and jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
@ -120,57 +118,57 @@
</div>
<div class="col-12 col-sm-6">
<h3>Fighting</h3>
<h3><span style="text-decoration: line-through;">Fighting</span></h3>
<div class="form-group">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="fight" checked>
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="fight" disabled>
<label class="custom-control-label" for="fight">Fight</label>
</div>
<div class="custom-control custom-switch custom-control-inline">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="air" checked>
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="air" disabled>
<label class="custom-control-label" for="air">Air</label>
</div>
<div class="custom-control custom-switch custom-control-inline">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="ground">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="ground" disabled>
<label class="custom-control-label" for="ground">Ground</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="boosters">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="boosters" disabled>
<label class="custom-control-label" for="boosters">Use ground boosters</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="continuous_fighting">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="continuous_fighting" disabled>
<label class="custom-control-label" for="continuous_fighting">Continue fighting all FF in round</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="next_energy" checked>
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="next_energy" disabled>
<label class="custom-control-label" for="next_energy">Fight for next WC +1hp/6min if reachable by FF</label>
</div>
</div>
<div class="form-group">
<div class="form-check form-check-inline">
<input type="radio" class="form-check-input" onchange="updateJson()" id="all_in" name="fight_amount" value="all_in">
<input type="radio" class="form-check-input" onchange="updateJson()" id="all_in" name="fight_amount" value="all_in" disabled>
<label class="form-check-label" for="all_in">All energy</label>
</div>
<div class="form-check form-check-inline">
<input type="radio" class="form-check-input" onchange="updateJson()" id="h_energy" name="fight_amount" value="h_energy" checked>
<input type="radio" class="form-check-input" onchange="updateJson()" id="h_energy" name="fight_amount" value="h_energy" disabled>
<label class="form-check-label" for="h_energy">1h energy</label>
</div>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="rw_def_side" checked>
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="rw_def_side" disabled>
<label class="custom-control-label" for="rw_def_side">In RWs fight on right side (occupier/defender)</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="travel_to_fight" checked>
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="travel_to_fight" disabled>
<label class="custom-control-label" for="travel_to_fight">Travel to fight</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="epic_hunt">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="epic_hunt" disabled>
<label class="custom-control-label" for="epic_hunt">Hunt epics</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="epic_hunt_ebs">
<input type="checkbox" class="custom-control-input" onchange="updateJson()" id="epic_hunt_ebs" disabled>
<label class="custom-control-label" for="epic_hunt_ebs">Spend <small>[all]</small> EBs in epics</label>
</div>
</div>
@ -262,7 +260,13 @@
</form>
</div>
<div class="col-12">
<pre id="json-output"></pre>
<div class="card">
<div class="card-body">
<h5 class="card-title">config.json</h5>
<h6 class="card-subtitle mb-2 text-muted">Copy-paste the content below into 'config.json' file</h6>
<pre id="json-output" class="bg-light card-text"></pre>
</div>
</div>
</div>
</div>
</div>

View File

@ -4,7 +4,7 @@
__author__ = """Eriks Karls"""
__email__ = "eriks@72.lv"
__version__ = "0.27.1"
__version__ = "0.27.2"
from erepublik.citizen import Citizen

View File

@ -290,7 +290,7 @@ class BaseCitizen(access_points.CitizenAPI):
solve_data = ApiReturn(
**self.post(
"https://api.erep.lv/captcha/api", data=dict(citizen_id=self.details.citizen_id, src=src, password="CaptchaDevAPI")
"https://erep.lv/captcha/api", data=dict(citizen_id=self.details.citizen_id, src=src, password="CaptchaDevAPI")
).json()
)
if solve_data["status"]:
@ -871,8 +871,8 @@ class BaseCitizen(access_points.CitizenAPI):
if re.search(
r"Occasionally there are a couple of things which we need to check or to implement in order make "
r"your experience in eRepublik more pleasant. <strong>Don\'t worry about ongoing battles, timer "
r"will be stopped during maintenance.</strong>|Maintenance. We&rsquo;ll be back any second now.",
r"your experience in eRepublik more pleasant\. <strong>Don't worry about ongoing battles, timer "
r"will be stopped during maintenance\.</strong>|Maintenance\. We&rsquo;ll be back any second now\.",
response.text,
):
self.write_warning("eRepublik is having maintenance. Sleeping for 5 mi#nutes")

View File

@ -697,7 +697,7 @@ class Reporter:
def __init__(self, citizen):
self._citizen = weakref.ref(citizen)
self._req = Session()
self.url = "https://api.erep.lv"
self.url = "https://erep.lv"
self._req.headers.update(
{
"user-agent": "eRepublik Script Reporter v3",

16
requirements-dev.txt Normal file
View File

@ -0,0 +1,16 @@
-r requirements.txt
-r requirements-tests.txt
bump2version==1.0.1
coverage==6.1.1
edx-sphinx-theme==3.0.0
flake8==4.0.1
ipython>=7.29.0
jedi!=0.18.0
isort==5.9.3
pre-commit==2.15.0
pur==5.4.2
responses==0.15.0
Sphinx==4.2.0
twine==3.4.2
wheel==0.37.0
black==21.7b0

2
requirements-tests.txt Normal file
View File

@ -0,0 +1,2 @@
-r requirements.txt
pytest==6.2.5

4
requirements.txt Normal file
View File

@ -0,0 +1,4 @@
PySocks==1.7.1
pytz==2021.3
requests==2.26.0
requests-toolbelt==0.9.1

View File

@ -1,22 +0,0 @@
bump2version==1.0.1
coverage==5.5
edx-sphinx-theme==3.0.0
flake8==3.9.2
ipython>=7.26.0
jedi!=0.18.0
isort==5.9.3
pip==21.2.4
pre-commit==2.14.0
pur==5.4.2
PyInstaller==4.5.1
PySocks==1.7.1
pytest==6.2.4
pytz==2021.1
requests==2.26.0
requests-toolbelt==0.9.1
responses==0.13.4
setuptools==57.4.0
Sphinx==4.1.2
twine==3.4.2
wheel==0.37.0
black==21.7b0

View File

@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.27.1
current_version = 0.27.2
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?
@ -29,7 +29,7 @@ max-line-length = 140
exclude = .git,log,debug,venv, build
[mypy]
python_version = 3.8
python_version = 3.9
check_untyped_defs = True
ignore_missing_imports = False
warn_unused_ignores = True

View File

@ -11,18 +11,15 @@ with open("README.rst") as readme_file:
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = [
"PySocks==1.7.1",
"pytz==2021.1",
"requests==2.26.0",
"requests-toolbelt==0.9.1",
]
with open("requirements.txt") as requirements_file:
requirements = requirements_file.read()
requirements = requirements.split()
setup_requirements = []
test_requirements = [
"pytest==6.2.4",
]
with open("requirements-tests.txt") as test_req_file:
test_requirements = test_req_file.read()
test_requirements = [line.strip() for line in test_requirements.split() if line.strip()[:2].strip() not in ("#", "-r")]
setup(
author="Eriks Karls",
@ -50,6 +47,6 @@ setup(
test_suite="tests",
tests_require=test_requirements,
url="https://github.com/eeriks/erepublik/",
version="0.27.1",
version="0.27.2",
zip_safe=False,
)