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

Modernize package #17

Merged
merged 10 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
labels:
- "dependencies"
open-pull-requests-limit: 2

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
23 changes: 23 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
25 changes: 10 additions & 15 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- '3.8'
- '3.9'
- '3.10'
- '3.11-dev'
- '3.11'

runs-on: ${{ matrix.os }}
name: Wheel for ${{ matrix.os }} (${{ matrix.python }})
Expand All @@ -42,11 +42,7 @@ jobs:
run: python -m pip install --upgrade build pip

- name: build wheel
run: python -m build --wheel

- name: build sdist
run: python -m build --sdist
if: ${{ matrix.os == 'macos-latest' && matrix.python == '3.10' }}
run: python -m build

- name: Store the packages
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -82,10 +78,10 @@ jobs:
- run: /opt/python/${{ matrix.python }}/bin/python -m venv .venv

- name: Install Python packages
run: .venv/bin/python -m pip install --upgrade build pip auditwheel
run: .venv/bin/python -m pip install --upgrade build pip auditwheel setuptools

- name: build wheel
run: .venv/bin/python -m build --wheel
- name: build
run: .venv/bin/python -m build

- name: multilinux stuff
run: |
Expand Down Expand Up @@ -117,7 +113,7 @@ jobs:
- {version: '3.8', wheel: 'cp38-cp38'}
- {version: '3.9', wheel: 'cp39-cp39'}
- {version: '3.10', wheel: 'cp310-cp310'}
- {version: '3.11-dev', wheel: 'cp311-cp311'}
- {version: '3.11', wheel: 'cp311-cp311'}

steps:
- name: Checkout
Expand All @@ -135,15 +131,14 @@ jobs:
path: dist/

- name: Install Python packages
run: python -m pip install --upgrade pip pytest
run: python -m pip install --upgrade pip

- name: install built wheel
run: python -m pip install dist/*-${{ matrix.python.wheel }}-*${{ matrix.os.wheel }}.whl
run: python -m pip install "$(ls dist/*-${{ matrix.python.wheel }}-*${{ matrix.os.wheel }}.whl)[test]"
shell: bash

- name: test
run: python -m pytest
working-directory: test

pypi:
runs-on: 'ubuntu-latest'
Expand All @@ -159,10 +154,10 @@ jobs:

- name: Publish 📦 to TestPyPI
if: ${{ github.ref == 'refs/heads/main' }}
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

- name: Publish 📦 to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
Expand Down
45 changes: 38 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,44 @@ Source/.vs/
Source/.vscode/
/Source/out

*.pyc
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

/.eggs
/build
/venv
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
/linux-venv
/dist

# Cython
/_dolphin_memory_engine.cpp
/dolphin_memory_engine.egg-info
/*.pyd

# Project
/python_src/dolphin_memory_engine/version.py
1 change: 0 additions & 1 deletion dolphin_memory_engine/__init__.py

This file was deleted.

40 changes: 38 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
[build-system]
requires = ["setuptools>=60.0.0", "Cython>=0.29.21", "setuptools_scm[toml]>=6.4"]
requires = [
"setuptools>=61.2",
"Cython>=0.29.21",
"setuptools_scm[toml]>=6.4"
]
build-backend = "setuptools.build_meta"

[project]
name = "dolphin-memory-engine"
description = "Hooks into the memory of a running Dolphin processes, allowing access to the game memory."
authors = [{name = "Henrique Gemignani"}]
classifiers = [
"License :: OSI Approved :: MIT License",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
requires-python = ">=3.7"
dependencies = []
dynamic = ["version"]

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.urls]
Homepage = "https://github.com/henriquegemignani/py-dolphin-memory-engine"

[project.optional-dependencies]
test = [
"pytest",
]

[tool.setuptools_scm]
local_scheme = "no-local-version"
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"
write_to = "python_src/dolphin_memory_engine/version.py"
41 changes: 41 additions & 0 deletions python_src/dolphin_memory_engine/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from dolphin_memory_engine._dolphin_memory_engine import (
MemWatch,
assert_hooked,
follow_pointers,

hook,
un_hook,
is_hooked,

read_byte,
read_bytes,
read_double,
read_float,
read_word,
write_byte,
write_bytes,
write_double,
write_float,
write_word,
)

__all__ = [
'MemWatch',
'assert_hooked',
'follow_pointers',

'hook',
'un_hook',
'is_hooked',

'read_byte',
'read_bytes',
'read_double',
'read_float',
'read_word',
'write_byte',
'write_bytes',
'write_double',
'write_float',
'write_word',
]
32 changes: 6 additions & 26 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
[metadata]
name = dolphin-memory-engine
description = Hooks into the memory of a running Dolphin processes, allowing access to the game memory.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/henriquegemignani/py-dolphin-memory-engine
author = Henrique Gemignani
license_files =
LICENSE

classifiers =
License :: OSI Approved :: MIT License
Development Status :: 3 - Alpha
Intended Audience :: Developers
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11

[options]
packages = dolphin_memory_engine
install_requires =

include_package_data = True
zip_safe = False
python_requires = >=3.7
packages = find:
package_dir =
= python_src

[options.packages.find]
where = python_src
Loading