Skip to content

Commit dd8a317

Browse files
authored
Merge pull request #29 from Galarzaa90/dev
v5.0.0
2 parents 8f26e23 + 5c72680 commit dd8a317

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+6905
-5569
lines changed

.github/workflows/analyze.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Analyze
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- dev
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
build:
12+
name: Test & Analyze
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout 🚚
16+
uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 1
19+
- name: Set up Python 🐍
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: 3.9
23+
- name: Install dependencies ⚙️
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -U -e .
27+
pip install -r requirements-testing.txt
28+
- name: Test with Coverage 🔧
29+
run: |
30+
coverage run setup.py test
31+
- name: Anaylze with Flake8 ❄️
32+
run: flake8 --output-file=flake8.txt --exit-zero
33+
- name: Generate Coverage Reports 📋
34+
run: |
35+
coverage report
36+
coverage xml
37+
- name: Upload reports 📤
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: reports
41+
path: |
42+
flake8.txt
43+
coverage.xml
44+
sonarcloud:
45+
name: SonarCloud
46+
runs-on: ubuntu-latest
47+
needs: build
48+
steps:
49+
- name: Checkout 🚚
50+
uses: actions/checkout@v2
51+
with:
52+
fetch-depth: 0
53+
- name: Download reports 📥
54+
uses: actions/download-artifact@v2
55+
with:
56+
name: reports
57+
- name: SonarCloud Scan ☁️
58+
uses: SonarSource/sonarcloud-github-action@master
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
62+
codecov:
63+
name: CodeCov
64+
runs-on: ubuntu-latest
65+
needs: build
66+
steps:
67+
- name: Download reports 📥
68+
uses: actions/download-artifact@v2
69+
with:
70+
name: reports
71+
- name: Upload to Codecov ☂️
72+
uses: codecov/codecov-action@v1

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ jobs:
99
strategy:
1010
max-parallel: 4
1111
matrix:
12-
python-version: [3.6, 3.7, 3.8, 3.9]
13-
12+
python-version: ["3.7", "3.8", "3.9"]
1413
steps:
1514
- uses: actions/checkout@v1
1615
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/docker.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Docker Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- dev
8+
- main
9+
tags:
10+
- v*
11+
12+
jobs:
13+
build:
14+
name: Build and Publish Images
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Cache Docker Layers 📦
18+
uses: actions/cache@v2
19+
with:
20+
path: /tmp/.buildx-cache
21+
key: ${{ runner.os }}-buildx-${{ github.sha }}
22+
restore-keys: |
23+
${{ runner.os }}-buildx-
24+
- name: Checkout 🚚
25+
uses: actions/checkout@v2
26+
27+
- name: Docker Meta 📋
28+
id: meta
29+
uses: docker/metadata-action@v3
30+
with:
31+
images: |
32+
ghcr.io/${{ github.repository }}
33+
${{ secrets.DOCKER_HUB_USERNAME }}/${{ secrets.DOCKER_HUB_REPO }}
34+
tags: |
35+
type=ref,event=branch
36+
type=pep440,pattern={{version}}
37+
type=pep440,pattern={{major}}.{{minor}}.{{patch}}
38+
type=pep440,pattern={{major}}.{{minor}}
39+
type=pep440,pattern={{major}}
40+
- name: Login to Docker Hub 🐳
41+
uses: docker/login-action@v1
42+
with:
43+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
44+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
45+
46+
- name: Login to GHCR 🐙
47+
uses: docker/login-action@v1
48+
with:
49+
registry: ghcr.io
50+
username: ${{ github.repository_owner }}
51+
password: ${{ secrets.GITHUB_TOKEN }}
52+
53+
- name: Set up Docker Buildx 🐋
54+
id: buildx
55+
uses: docker/setup-buildx-action@v1
56+
57+
- name: Build and Push 🚀
58+
id: docker_build
59+
uses: docker/build-push-action@v2
60+
with:
61+
context: ./
62+
file: ./Dockerfile
63+
builder: ${{ steps.buildx.outputs.name }}
64+
push: true
65+
tags: ${{ steps.meta.outputs.tags }}
66+
labels: ${{ steps.meta.outputs.labels }}
67+
cache-from: type=local,src=/tmp/.buildx-cache
68+
cache-to: type=local,dest=/tmp/.buildx-cache

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build:
44
image: latest
55

66
python:
7-
version: 3.6
7+
version: 3.8
88
pip_install: true
99
extra_requirements:
1010
- docs

.run/Coverage (HTML).run.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Coverage (HTML)" type="PythonConfigurationType" factoryName="Python">
3+
<module name="tibia.py" />
4+
<option name="INTERPRETER_OPTIONS" value="" />
5+
<option name="PARENT_ENVS" value="true" />
6+
<envs>
7+
<env name="PYTHONUNBUFFERED" value="1" />
8+
</envs>
9+
<option name="SDK_HOME" value="$PROJECT_DIR$/venv/bin/python" />
10+
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
11+
<option name="IS_MODULE_SDK" value="false" />
12+
<option name="ADD_CONTENT_ROOTS" value="true" />
13+
<option name="ADD_SOURCE_ROOTS" value="true" />
14+
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
15+
<option name="SCRIPT_NAME" value="coverage" />
16+
<option name="PARAMETERS" value="html" />
17+
<option name="SHOW_COMMAND_LINE" value="false" />
18+
<option name="EMULATE_TERMINAL" value="false" />
19+
<option name="MODULE_MODE" value="true" />
20+
<option name="REDIRECT_INPUT" value="false" />
21+
<option name="INPUT_FILE" value="" />
22+
<method v="2">
23+
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Coverage (Run)" run_configuration_type="PythonConfigurationType" />
24+
</method>
25+
</configuration>
26+
</component>

.run/Coverage (Run).run.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Coverage (Run)" type="PythonConfigurationType" factoryName="Python">
3+
<module name="tibia.py" />
4+
<option name="INTERPRETER_OPTIONS" value="" />
5+
<option name="PARENT_ENVS" value="true" />
6+
<envs>
7+
<env name="PYTHONUNBUFFERED" value="1" />
8+
</envs>
9+
<option name="SDK_HOME" value="$PROJECT_DIR$/venv/bin/python" />
10+
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
11+
<option name="IS_MODULE_SDK" value="false" />
12+
<option name="ADD_CONTENT_ROOTS" value="true" />
13+
<option name="ADD_SOURCE_ROOTS" value="true" />
14+
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
15+
<option name="SCRIPT_NAME" value="coverage" />
16+
<option name="PARAMETERS" value="run setup.py test" />
17+
<option name="SHOW_COMMAND_LINE" value="false" />
18+
<option name="EMULATE_TERMINAL" value="false" />
19+
<option name="MODULE_MODE" value="true" />
20+
<option name="REDIRECT_INPUT" value="false" />
21+
<option name="INPUT_FILE" value="" />
22+
<method v="2" />
23+
</configuration>
24+
</component>

CHANGELOG.rst

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,55 @@ Changelog
66
Due to this library relying on external content, older versions are not guaranteed to work.
77
Try to always use the latest version.
88

9+
.. v5.0.0
10+
11+
5.0.0 (Unreleased)
12+
==================
13+
- Added parsing for Tibia Drome leaderboards, new ``Leaderboard`` class.
14+
- Auxiliary classes ``LeaderboardEntry`` and ``LeaderboardRotation`` were added as well.
15+
- New ``Client`` method: ``fetch_leaderboards``.
16+
- Added parsing for Spells library, new ``SpellsSection class.
17+
- Auxiliary classes ``Spell`` and ``SpellEntry``.
18+
- New ``Client`` methods: ``fetch_spell`` and ``fetch_spells``
19+
- Fix last page of highscores having ``0`` as page value.
20+
- Using the ``Client`` class, you can now fetch and parse content from the test version of www.tibia.com when available.
21+
- Note that if the test website has changes, parsing might not be possible.
22+
- Internal URL attributes might still point to the regular website.
23+
- New ``HousesSection`` class, including the house filtering attributes.
24+
- New ``NewsArchive`` class, including the news filtering attributes.
25+
- New ``GuildsSection`` class, to replace the lists of ``GuildEntry``
26+
- Many "ListedObject" classes were renamed to "ObjectEntry", for details check the breaking changes below.
27+
- Fixed bug with other characters not being parsed.
28+
- Added ``traded`` attribute to ``LastPost`` class.
29+
- Added ``thread_starter_traded`` attribute to ``ThreadEntry``
30+
31+
**Breaking Changes**:
32+
33+
- Python 3.7 or higher is now required.
34+
- House classes no longer have ``get_list_url`` and ``list_from_content`` methods.
35+
- ``Client.fetch_world_houses`` now returns a ``HousesSection`` instance in its data attribute, instead of a list of ``ListedHouses``.
36+
- ``ListedHouse.highest_bid`` attribute now may be ``None`` if the house's auction has not yet started.
37+
- ``ListedHouse`` class renamed to ``HouseEntry``.
38+
- Removed deprecated property ``AuctionFilters.item``.
39+
- ``Client.fetch_news_archive``, ``Client.fetch_recent_news`` now returns an instance of ``NewsArchive`` in the ``data`` attribute.
40+
- ``ListedNews`` class renamed to ``NewsEntry``.
41+
- ``News`` and ``NewsEntry`` no longer have a ``get_list_url`` method.
42+
- ``ListedBoard`` class renamed to ``BoardEntry``.
43+
- ``ListedThread`` class renamed to ``ThreadEntry``.
44+
- ``ListedAnnouncement`` class renamed to ``AnnouncementEntry``.
45+
- ``ListedWorld`` class renamed to ``WorldEntry``.
46+
- ``ListedAuction`` class renamed to ``AuctionEntry``.
47+
- ``AuctionDetails`` class renamed to ``Auction``.
48+
- ``ListedGuild`` class renamed to ``GuildEntry``.
49+
- ``ListedTournament`` class renamed to ``TournamentEntry``.
50+
- ``Creature`` class renamed to ``CreatureEntry``.
51+
- ``CreatureDetail`` class renamed to ``Creature``.
52+
- ``Guild`` and ``GuildEntry`` class no longer have a ``get_list_url`` method.
53+
- Renamed ``begin_date`` parameter to ``start_date`` in ``fetch_news_archive``.
54+
- Renamed ``race`` attribute of ``CreatureEntry`` and ``Creature`` to ``identifier``, method parameters renamed as well.
55+
- ``CreaturesSection.from_boosted_creature_header`` renamed to ``CreaturesSection.boosted_creature_from_header``.
56+
57+
958
.. v4.1.7
1059
1160
4.1.7 (2021-06-30)
@@ -17,7 +66,7 @@ Changelog
1766
4.1.6 (2021-06-28)
1867
==================
1968
- Fixed worlds not being parsed correctly again due to tournament worlds order changing. After this fix,
20-
the order should not matter anymore.
69+
the order should not matter anymore.
2170

2271
.. v4.1.5
2372

0 commit comments

Comments
 (0)