Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0.0a5 #336

Merged
merged 29 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:

- name: Install Poetry
uses: abatilo/actions-poetry@v2

- name: Setup a local virtual environment for poetry
shell: bash
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
Expand All @@ -60,10 +62,12 @@ jobs:
key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Install awpy
shell: bash
run: |
poetry install --no-interaction

- name: Formatting + Lint
shell: bash
run: |
poetry run ruff check . --fix --exit-zero
poetry run ruff check .
Expand All @@ -75,8 +79,9 @@ jobs:
# run: poetry run pylint awpy

- name: Test
shell: bash
run: |
poetry run coverage run -m pytest --durations=10
poetry run coverage run -m pytest --durations=10 -s --traceconfig --log-cli-level=DEBUG tests/
poetry run coverage report -m

# - name: Archive code coverage results
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- name: Build Sphinx documentation
run: |
poetry run sphinx-build -b html docs/source docs/build/html
poetry run sphinx-build -b html docs/ docs/build/html

- name: Upload documentation to Read the Docs
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:

- name: Publish to test PyPI
run: |
poetry publish --build --repository testpypi --username __token__ --password ${{ secrets.TEST_PYPI_API_TOKEN }}
poetry publish --build --repository testpypi --username __token__ --password ${{ secrets.TEST_PYPI_API_TOKEN }} -v

- name: Publish to PyPI
run: |
poetry publish --build --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}
poetry publish --build --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} -v
26 changes: 12 additions & 14 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.9"
post_create_environment:
os: "ubuntu-22.04"
tools:
python: "3.10"
jobs:
post_create_environment:
# Install poetry
- pip install poetry
# Tell poetry to not use a virtual environment
- poetry config virtualenvs.create false
post_install:
# Install dependencies
- poetry install
# https://python-poetry.org/docs/#installing-manually
- python -m pip install poetry
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
configuration: docs/conf.py
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# The short X.Y version
version = ""
# The full version, including alpha/beta/rc tags
release = "2.0.0a4"
release = "2.0.0a5"


# -- General configuration ---------------------------------------------------
Expand Down
207 changes: 88 additions & 119 deletions poetry.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "awpy"
version = "2.0.0a4"
version = "2.0.0a5"
description = "Counter-Strike 2 demo parsing, analysis and visualization"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -32,20 +32,20 @@ python = ">=3.9"
click = ">=8.1.7"
loguru = ">=0.7.2"
matplotlib = ">=3.9.0"
numpy = ">=1.26.3"
numpy = ">=2.0.0"
pandas = ">=2.2.2"
setuptools = ">=69.2.0"
setuptools = ">=70.1.0"
demoparser2 = ">=0.26.2"
tqdm = "^4.66.4"

[tool.poetry.dev-dependencies]
black = { version = "^24.4.2", extras = ["jupyter"] }
pytest = "^6.2"
pytest = "^8.2.2"
requests = "^2.32.3"
ruff = "^0.0.259"
pyright = "^1.1.198"
pylint = "^3.2.2"
coverage = "^5.5"
ruff = "^0.4.10"
pyright = "^1.1.368"
pylint = "^3.2.3"
coverage = { version = "^7.5.3", extras = ["toml"] }
sphinx = "^7.3.7"
sphinx-rtd-theme = "^2.0.0"
nbsphinx = "^0.9.3"
Expand Down
8 changes: 3 additions & 5 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestCommandLine:
"""Tests the Awpy command line interface."""

@pytest.fixture(autouse=True)
def setup(self): # noqa: PT004
def setup_runner(self, setup): # noqa: ANN001, ARG002, PT004
"""Setup CLI runner."""
self.runner = CliRunner()

Expand All @@ -27,12 +27,10 @@ def test_parse_invalid_filepath(self):

def test_parse_zip_creation(self):
"""Test that the parse command produces a zip file."""
tmpfile = Path("tests/spirit-vs-mouz-m1-vertigo.dem")
result = self.runner.invoke(parse, [str(tmpfile)])
print(result.stdout)
result = self.runner.invoke(parse, ["tests/spirit-vs-mouz-m1-vertigo.dem"])
assert result.exit_code == 0

zip_name = Path(Path(tmpfile.name).stem + ".zip")
zip_name = "spirit-vs-mouz-m1-vertigo.zip"
assert os.path.exists(zip_name)

with zipfile.ZipFile(zip_name, "r") as zipf:
Expand Down