Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
6698cc1
Add mode support for Galaxian
Dec 23, 2017
1aa302d
Gah, remove leftover debug messages
Dec 24, 2017
a6e1ca4
Add difficulty levels available. Set mode to 1 if mode=0 is passed in
Dec 29, 2017
f7fff87
Merge pull request #234 from alito/galaxianmodes
mcmachado Dec 29, 2017
4280135
Reset actions on reset
ezliu Aug 27, 2018
264f5eb
Merge pull request #252 from ezliu/fix_repeat_action_prob
mgbellemare Sep 8, 2018
a7efa33
Removed extra curly brace from example agent
brollb Oct 3, 2018
6ff921e
Merge pull request #253 from brollb/master
mgbellemare Oct 3, 2018
717d1c0
mod CMakeLists.txt
Nov 14, 2018
b2f7557
Merge pull request #256 from pfinsider-m/workaround-to-sdl-header-not…
mgbellemare Nov 16, 2018
d5bdf58
Updating reference of recent JAIR paper.
mcmachado May 31, 2019
4e51d48
Fix switch fall-through in Gravitor.cpp
lespeholt Jul 1, 2019
ce77d0d
Merge pull request #264 from lespeholt/patch-1
mgbellemare Jul 3, 2019
59b65a2
Optimize Atari emulator by inlining memory access methods and
qstanczyk Jul 9, 2019
5e3c3c1
Merge pull request #265 from qstanczyk/master
mgbellemare Jul 17, 2019
3d0fe52
[Paddles.hxx] Add missing includion of Event.hxx
tkoeppe Nov 19, 2019
f916001
Merge pull request #276 from tkoeppe/event
mgbellemare Nov 21, 2019
831a11d
Change line endings to LF
tkoeppe Nov 19, 2019
799d971
Remove trailing whitespace from all code files.
tkoeppe Nov 22, 2019
9ba2d88
Remove further trailing whitespace from all code files.
tkoeppe Nov 25, 2019
078b9d2
Normalize final newlines in files
tkoeppe Nov 25, 2019
705d3ea
[travis, presubmit] Adds a presubmit script that checks for trailing …
tkoeppe Nov 22, 2019
61d18b3
[travis] Updates the Travis-chosen Linux distribution.
tkoeppe Nov 26, 2019
0c6b14c
[games/Adventure] Adds game modes and difficulties.
tkoeppe Nov 26, 2019
c0135aa
[ale_state] Makes "paddle min/max" configurable.
tkoeppe Nov 26, 2019
6b11ab7
[travis] Build examples, reduce number of jobs, update distro.
tkoeppe Nov 28, 2019
10aeabc
ale-py/ Find zlib and changes for Windows build
JesseFarebro Sep 25, 2019
c6c6709
ale-py/ Include algorithm to fix min() in IceHockey
JesseFarebro Sep 25, 2019
2922f5e
Reformat non-games ALE files
tkoeppe Nov 26, 2019
9495945
Reformat games ALE files
tkoeppe Nov 26, 2019
01da69f
[README] Reformat markdown sources
tkoeppe Dec 9, 2019
4d475ad
ale-py/ Merge atari-py into ale-py
JesseFarebro Sep 26, 2019
96b0e0c
Reformat further files
tkoeppe Jan 7, 2020
27fec07
[README] Document code style conventions
tkoeppe Jan 7, 2020
02a3bd8
Merge pull request #272 from JesseFarebro/ale-py
mgbellemare Jan 9, 2020
7746d0f
Reformat further files and apply style conventions
tkoeppe Jan 9, 2020
f155f44
User feedback if we can't find a valid wrapper
JesseFarebro Jan 15, 2020
81cc4bd
Move ALE C++ code into namespace "ale"
tkoeppe Jan 15, 2020
11868d1
Merge pull request #294 from JesseFarebro/rom-load-exception
mgbellemare Jan 15, 2020
f3e431a
[games/RomSettings] Add a convenience function to check if a mode is …
tkoeppe Jan 16, 2020
b4d1e07
[games/RomUtils] Add a function "readMappedRam" to read a byte of mem…
tkoeppe Jan 16, 2020
2b6cbe1
Merge pull request #295 from tkoeppe/newfeatures
mgbellemare Jan 21, 2020
3ab022c
[games/supported] Consistently use "override" (rather than "virtual" …
tkoeppe Jan 16, 2020
e7dd33a
[emucore/TIA] Improve const-correctness
tkoeppe Jan 21, 2020
84b3a02
Merge pull request #296 from tkoeppe/override
mgbellemare Jan 22, 2020
26ada40
Merge pull request #297 from tkoeppe/const
mgbellemare Jan 22, 2020
8878209
[emucore/TIA.cxx] Make initialization of static data thread-safe.
tkoeppe Jan 21, 2020
dc34eee
Merge pull request #298 from tkoeppe/const
mgbellemare Jan 29, 2020
77bf1ff
[stella_environment] Expose system pseudo-random number generator
tkoeppe Jan 29, 2020
9c3f24c
[emucore, Cart*] Delete old, process-global RNG instance.
tkoeppe Jan 29, 2020
044c4b1
[emucore/Settings] Declare additional settings
tkoeppe Jan 29, 2020
4e681d6
[Constants] Remove unnecessary dependency on Stella headers.
tkoeppe Feb 3, 2020
2121bf7
[emucore/Cart] Make "about string" part of the state
tkoeppe Feb 11, 2020
deaf797
[ale_interface, main] Move I/O buffer handling to main
tkoeppe Feb 17, 2020
97ef847
[games/DoubleDunk] Fix signedness
tkoeppe Feb 3, 2020
80783f5
[game/RomSettings, ale_interface] Add settings customization hook
tkoeppe Feb 19, 2020
de52320
[emucore/M6502.cxx] Make initialization of static data thread-safe.
tkoeppe Feb 19, 2020
1eacbbd
[games] Stylistic cleanup
tkoeppe Feb 21, 2020
71eff7e
[games] Simplify "clone()" implementation
tkoeppe Feb 26, 2020
3bee0b6
[ale_interface] Delay loadSettings until after modifications
tkoeppe Feb 27, 2020
6a7d21e
[ale_interface, stella_environment] Expose difficulty and mode
tkoeppe Feb 27, 2020
5e68ddd
[ale_ram] Simplify and clean up
tkoeppe Mar 11, 2020
6a61d5d
ale-py/ Github actions
JesseFarebro Dec 7, 2019
7895d34
Use C++ algorithm for min in display_screen
JesseFarebro Dec 11, 2019
15451ff
Remove travis
JesseFarebro Feb 7, 2020
bba1400
Merge pull request #305 from JesseFarebro/ale-py
JesseFarebro Mar 20, 2020
b17d491
[emucore/OSystem.cxx] Delete dynamically allocated objects
tkoeppe Mar 11, 2020
8fc678f
[games/Adventure] Randomise frame count when setting game mode
tkoeppe Mar 23, 2020
27bd774
[games/Frogger] Additional game modes
tkoeppe Mar 23, 2020
5ecc32e
[games/KingKong] Additional game modes
tkoeppe Mar 23, 2020
8d04988
[games/MrDo] Additional game modes
tkoeppe Mar 23, 2020
d95c36b
[games/Pong] Additional difficulty settings
tkoeppe Mar 23, 2020
c59610f
[games/Trondead] Additional difficulty settings
tkoeppe Mar 23, 2020
d9bfe95
[games/Turmoil] Additional game modes
tkoeppe Mar 23, 2020
f685a00
[games/LostLuggage] Additional game modes and difficulty settings
tkoeppe Mar 23, 2020
b948a1a
[ale_interface] Reinstate a call to loadSettings on error path
tkoeppe Mar 24, 2020
35d011f
[ale_interface] Move default argument to the public declaration
tkoeppe Mar 25, 2020
66f519b
Use more idiomatic constructions; qualify names properly
tkoeppe Mar 27, 2020
bbc5c64
[emucore/{OSystem,Cart}.cxx] Fix several bugs in handing invalid ROMs.
tkoeppe Mar 27, 2020
3924504
[games] Several new games
tkoeppe Mar 24, 2020
31fd753
Update ALE JAIR link, build badge
JesseFarebro Mar 29, 2020
b752d15
Remove old build system: module.mk files, makefiles
JesseFarebro Mar 29, 2020
8e38fa7
Remove TinyMT, we now use STL random
JesseFarebro Mar 29, 2020
38251ed
misc_tools.h is unused
JesseFarebro Mar 30, 2020
ac4a7bc
Bump GHA actions/checkout to v2
JesseFarebro Mar 31, 2020
5497a4d
Merge pull request #333 from JesseFarebro/gha-checkout-v2
JesseFarebro Mar 31, 2020
ec8a163
Remove controllers & ale cli
JesseFarebro Mar 29, 2020
62a4136
Remove deprecated examples, update remaining examples
JesseFarebro Mar 31, 2020
78e7d9e
Remove relevant deprecations from CMakeLists.txt
JesseFarebro Mar 31, 2020
8832a58
[games/supported] Use correct type (int) for large numeric values.
tkoeppe Apr 2, 2020
02263ee
Merge pull request #335 from tkoeppe/inttypes
JesseFarebro Apr 3, 2020
8ddf267
[md5.txt] Add MD5 checksums for ROM binaries for newly supported games
tkoeppe Apr 17, 2020
08ba5f4
Merge pull request #343 from tkoeppe/md5
JesseFarebro Apr 17, 2020
4e2150a
[SoundExporter.hpp, games/MiniatureGolf.hpp] Use "constexpr" for stat…
tkoeppe Apr 17, 2020
91eace6
Merge pull request #332 from JesseFarebro/deprecations
JesseFarebro Apr 18, 2020
186abae
Remove redundant namespace qualifications and stream flushes
tkoeppe Apr 20, 2020
3bbcc8a
remove duplicate roadrunner (#348)
jkterry1 May 1, 2020
95172ca
CMake modernization with version centralization
JesseFarebro Mar 29, 2020
60b2325
Consolidate licenses and acknowledgements.
JesseFarebro Mar 29, 2020
014341a
Remove manual swap port modification
JesseFarebro Apr 28, 2020
8ee0e3a
Perform SwapPort for Surround
JesseFarebro May 13, 2020
954b718
[emucore] Clarify setting error message.
tkoeppe Jul 20, 2020
3343d62
[common] Add missing "std::" qualification in header.
tkoeppe Jul 20, 2020
d3f2b25
Let ROMs set their default mode. Default implementation returns the f…
Dec 30, 2017
4232146
fixed othello terminate-if-fire issue (#364)
benblack769 Sep 2, 2020
4b04a83
[ale_interface] Separate "getString" into copying and non-copying ver…
tkoeppe Aug 25, 2020
371b72f
[games] Renumber game modes.
tkoeppe Sep 7, 2020
ff1c467
Remove old ale-py interface
JesseFarebro Mar 29, 2020
47a9d61
ale-py pybind11 interface
JesseFarebro May 15, 2020
ba12975
ale-py unit tests
JesseFarebro May 15, 2020
77ee63b
ale-py build & deployment
JesseFarebro Mar 30, 2020
b391bb3
Resolve relative imports & use src as root search path
JesseFarebro Sep 7, 2020
2284b37
Remove redundent CMake search paths
JesseFarebro May 15, 2020
987d313
Move m6502 -> emucore, bspf -> emucore.
JesseFarebro Mar 29, 2020
c68ff3d
Functional MD5 Check + Public `isSupportedRom` API
benblack769 May 24, 2020
7bb7f39
ale-py: Improve shape mismatch errors
JesseFarebro Nov 17, 2020
3265fec
Limit scope of CMake flags, refactor CMake Python testing, style cons…
JesseFarebro Nov 17, 2020
e6adf39
Bump pybind11 -> v2.6.1
JesseFarebro Nov 18, 2020
15a39a3
More robust version handling
JesseFarebro Dec 29, 2020
f0cd981
Python setuptools refactor
JesseFarebro Dec 29, 2020
9b98fdc
requirements* for PyPi dependencies
JesseFarebro Dec 29, 2020
f65fb5a
Improve vcpkg support
JesseFarebro Dec 29, 2020
d3196f1
Remove leftovers from Stella
JesseFarebro Dec 31, 2020
ab10bb1
Remove Stella CheatManager
JesseFarebro Jan 1, 2021
936add3
Remove Stella Debugger
JesseFarebro Jan 1, 2021
d819dff
Remove user-defined config files
JesseFarebro Jan 1, 2021
ccb5264
Remove leftover settings
JesseFarebro Jan 1, 2021
53768e7
Bump C++ STD version to 17
JesseFarebro Jan 1, 2021
8cc9d68
Remove os_dependent in favour of C++17 filesystem
JesseFarebro Jan 1, 2021
6fa100f
Cleanup OSystem, remove loop + timing info
JesseFarebro Jan 1, 2021
849a246
STL std:: namespace prefix
JesseFarebro Jan 1, 2021
74f321f
Fix `cassert` import in `ale_state.cpp`
JesseFarebro Jan 1, 2021
6ed3120
Remove Stella Array in favor of std::vector
JesseFarebro Jan 1, 2021
745c146
Use fs::path for rom loading
JesseFarebro Jan 2, 2021
4c89fa6
Remove bspf, use standard C++ cstdint
JesseFarebro Jan 2, 2021
fc79397
Remove AtariVox
JesseFarebro Jan 2, 2021
cb59fff
Remove `Keyboard` controller type
JesseFarebro Jan 2, 2021
50a245b
Remove `Booster` controller type
JesseFarebro Jan 2, 2021
c729e53
Remove `Driving` controller type
JesseFarebro Jan 2, 2021
550fd91
Remove remaining `TrakBall` controller reference
JesseFarebro Jan 2, 2021
c1c45de
Remove unused `Event` types
JesseFarebro Jan 2, 2021
c98c43f
Refactor `Console` to remove unused methods
JesseFarebro Jan 2, 2021
9a6b496
Refactor `OSystem` to remove unused methods
JesseFarebro Jan 2, 2021
9f838b9
Fix `DefProps` initialization size
JesseFarebro Jan 3, 2021
935ee73
Use cached framerate in `SoundSDL`
JesseFarebro Jan 3, 2021
32747ab
Replace `SoundSDL` auto_ptr + namespace typos
JesseFarebro Jan 3, 2021
2edef72
`Sound*` only requires access to `Settings` not `OSystem`
JesseFarebro Jan 3, 2021
5eb3a90
Revamped README
JesseFarebro Sep 8, 2020
188686d
Create CONTRIBUTING.md
JesseFarebro Sep 8, 2020
15b4f12
Update and rename ChangeLog to CHANGELOG.md
JesseFarebro Sep 8, 2020
00d04cf
Remove bspf acknowledgment, we no longer use bspf
JesseFarebro Jan 4, 2021
8f3a912
vcpkg sdl1 typo, revert ALE logo dark mode
JesseFarebro Jan 13, 2021
d7f80bd
Improve vcpkg discovery, disable in-source builds
JesseFarebro Jan 13, 2021
c525ef1
CI updates, cibuildwheel -> pypa, token consistency
JesseFarebro Jun 11, 2021
25544ab
Python build updates, preparation for conda builds
JesseFarebro Jun 11, 2021
a59e329
Update pypa/cibuildwheel@v2
JesseFarebro Jul 16, 2021
e4aa5c3
[ale-py] Prevent file I/O race condition
JesseFarebro Jul 19, 2021
77d8bb3
Fix address for patching bankswitch type UA
JesseFarebro Jul 25, 2021
4611970
SDL2 support
JesseFarebro Aug 1, 2021
567284f
Package SDL2 with ale-py
JesseFarebro Aug 1, 2021
19b4a3c
Update changelog format and include unreleased changes
JesseFarebro Aug 25, 2021
3963207
Use std::optional for isSupportedROM, requires C++17
JesseFarebro Dec 30, 2020
a61c860
ale-py roms package (ale-import-roms)
JesseFarebro Aug 27, 2021
5f9fa21
ale-py gym support
JesseFarebro Aug 27, 2021
d8a89c5
ale-py gym test suite
JesseFarebro Aug 20, 2021
e016d07
Support OSX arm64 wheels
JesseFarebro Aug 29, 2021
a5381b0
Remove PDF manual
JesseFarebro Mar 31, 2020
895b09e
New Markdown docs
JesseFarebro Apr 2, 2020
fdfa85b
Remove old docs leftover figure
JesseFarebro Sep 9, 2021
81c79ee
Remove leftover Stella icons
JesseFarebro Sep 9, 2021
cdbf45f
Remove leftover environment include directive
JesseFarebro Sep 9, 2021
8e5c95a
Register Gym v5 environments
JesseFarebro Sep 9, 2021
c913e95
Move OSystem::Random -> System::Random for determinism + clone API de…
JesseFarebro Jan 4, 2021
d9f3e99
Add support for setRAM
benblack769 Dec 5, 2020
bab5a2b
macOS arm64: respect ARCHFLAGS, don't use ninja
JesseFarebro Sep 9, 2021
ea545a2
Remove reference to old website
JesseFarebro Sep 9, 2021
431694c
Remove setuptools install dependency
JesseFarebro Sep 9, 2021
626ba58
Update README with PyPI package and Gym support
JesseFarebro Sep 10, 2021
d2bd8e7
Cleanup importlib_metadata for Python init
JesseFarebro Sep 10, 2021
a54a328
Version bump: 0.7
JesseFarebro Sep 10, 2021
9f1bf5e
Update CHANGELOG.md
JesseFarebro Sep 14, 2021
0475671
Add a missing std namespace qualifier
mmjjnn Sep 28, 2021
0e6d027
Move ale-py.gym -> gym.envs.atari namespace package
JesseFarebro Sep 16, 2021
8705b91
Rework warning messages + hush warnings as the package gets called wh…
JesseFarebro Sep 16, 2021
df92791
Version bump, v0.7.1
JesseFarebro Sep 28, 2021
b7b0c1a
Update metadata and move CI config to pyproject.toml
JesseFarebro Sep 28, 2021
125795b
Update CHANGELOG.md
JesseFarebro Sep 28, 2021
5d26b0c
Fixed reading ROM files on Windows for isSupportedROM
JesseFarebro Oct 7, 2021
76b786d
Package Tetris by Colin Hughes
JesseFarebro Oct 7, 2021
b115163
Bump version: 0.7.2
JesseFarebro Oct 7, 2021
a7a216c
Build Python 3.10 wheels, deprecate Python 3.6
JesseFarebro Oct 7, 2021
d48bbfb
Update CHANGELOG.md
JesseFarebro Oct 7, 2021
c9b9064
Fix v0.7.2 tag in CHANGELOG.md
JesseFarebro Oct 7, 2021
d55ae97
Update README.md, exclude ale-py import, add link to v0.7 blog post
JesseFarebro Oct 7, 2021
ce67fc6
Bump python-requires in setup.cfg
JesseFarebro Oct 7, 2021
79ffb7d
Add PyPI badge
JesseFarebro Oct 8, 2021
02193dc
Add environment variable `ALE_PY_ROM_DIR`
JesseFarebro Nov 2, 2021
6587ef7
Add macos-cp310 test, only install np binary, bump cibuildwheel
JesseFarebro Nov 2, 2021
978d2ce
Version bump: v0.7.3
JesseFarebro Nov 2, 2021
0af0ff4
Update changelog
JesseFarebro Nov 2, 2021
8a6c770
ALE Namespace wrapper for emucore (#445)
tuero Feb 16, 2022
7aa7e67
vcpkg manifest
JesseFarebro Dec 21, 2021
307b3ee
Pin cmake at 3.20
JesseFarebro Feb 16, 2022
5cf184f
Update cibuildwheel, change to cibw pyproject tooling
JesseFarebro Dec 14, 2021
af8124c
Modify Gym v5 defaults to be more aligned with post-DQN results
JesseFarebro Dec 14, 2021
7b94962
Support new Gym reset API & add compliance tests
JesseFarebro Dec 14, 2021
bb90b2f
Fix bug with terminal signal on ChopperCommand (#434)
JesseFarebro Dec 21, 2021
3d427e0
Update manylinux2014_x86_64-vcpkg to install proper dependencies
JesseFarebro Dec 21, 2021
33caf9d
Update importlib_metadata entry_points API call
JesseFarebro Dec 21, 2021
069f8bd
Version bump: v0.7.4
JesseFarebro Dec 21, 2021
1c77628
Update changelog
JesseFarebro Feb 17, 2022
e2923c8
Update environment.py (#448)
vwxyzjn Mar 14, 2022
6c88991
Move setup.cfg -> pyproject.toml & remove Distribution to fix setupto…
JesseFarebro Apr 15, 2022
2804cb2
Remove render('human'), update seeding API, add frameskip validation
JesseFarebro Apr 15, 2022
ae4265e
Add pre-commit and fix existing files.
JesseFarebro Apr 18, 2022
ffe3eee
Bump SDL -> 2.0.16
JesseFarebro Apr 17, 2022
6eb8ef8
Update workflow scripts
JesseFarebro Apr 17, 2022
18d79d3
Make ROM loading more robust by using module level __getattr__
JesseFarebro Apr 17, 2022
5beba6c
Add py.typed to ale-py
JesseFarebro Apr 17, 2022
db37282
Version bump: 0.7.5
JesseFarebro Apr 16, 2022
8f3bc3b
Update changelog
JesseFarebro Apr 18, 2022
adb1285
Add `const` keyword to getters (#457)
AlessioZanga Jun 12, 2022
e883e5a
Lazy load ROMs via plugins (#460)
JesseFarebro Jun 14, 2022
8e1bcc5
Refactor import-roms
JesseFarebro Jun 14, 2022
d9b37f8
Package fixes and cleanups (#461)
JesseFarebro Jun 14, 2022
652f8b8
Fix invalid terminal check from Gym
JesseFarebro Jun 16, 2022
813abf2
Add threading lock when we're lazy loading ROMs
JesseFarebro Jun 20, 2022
969857f
New ROM plugin API (#462)
JesseFarebro Jun 22, 2022
d68be99
Add proper truncation check to ALE interface
JesseFarebro Sep 4, 2022
ec2796b
Add truncation on loss-of-life
JesseFarebro Sep 4, 2022
093979a
Add reward clipping settings
JesseFarebro Sep 4, 2022
bfee9e3
Gym v0.26 compliance
JesseFarebro Sep 5, 2022
f1d963c
Version bump
JesseFarebro Sep 5, 2022
d59d006
Add support for Python 3.11
JesseFarebro Sep 5, 2022
679288f
Update changelog
JesseFarebro Sep 5, 2022
32a6799
FIX: add render_mode attribute to legacy Gym environment (#476)
younik Feb 17, 2023
1477c1d
Update pinned vcpkg for CI
JesseFarebro Feb 17, 2023
f9420f6
Update vcpkg package version
JesseFarebro Feb 17, 2023
8db8fac
Update CI to official Python 3.11
JesseFarebro Feb 17, 2023
9b67314
Work around for macOS pkg-config
JesseFarebro Feb 17, 2023
4b24d55
Fix invalid ROM names (#481)
JesseFarebro Feb 17, 2023
26b7961
Include type stubs for native code (#482)
JesseFarebro Feb 17, 2023
1964c0b
Revert back to glibc 2.17 for wheels
JesseFarebro Feb 17, 2023
1eb8f73
Work around for macOS pkg-config when building wheels
JesseFarebro Feb 17, 2023
8a2d129
Bump cibuildwheel
JesseFarebro Feb 17, 2023
ba84c14
Version bump: 0.8.1
JesseFarebro Feb 17, 2023
6b784d2
Update changelog
JesseFarebro Feb 17, 2023
259f249
Change @typing.overload -> @overload for Python stubs
JesseFarebro Apr 19, 2023
c9df9e4
Rework frame processing & add frame maxing
JesseFarebro Jun 12, 2023
c46e870
Add missing <cassert> import
JesseFarebro Jun 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# See also https://help.github.com/en/github/using-git/configuring-git-to-handle-line-endings.

# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Always normalize these file types.
*.c text
*.cc text
*.cpp text
*.cxx text
*.h text
*.hpp text
*.hxx text
*.java text
*.txt text
*.md text
13 changes: 13 additions & 0 deletions .github/actions/download-release-asset/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM alpine:latest

RUN apk add --no-cache \
bash \
ca-certificates \
curl \
wget \
jq

COPY download-asset.sh /usr/bin/download-asset
RUN chmod +x /usr/bin/download-asset

ENTRYPOINT ["/usr/bin/download-asset"]
15 changes: 15 additions & 0 deletions .github/actions/download-release-asset/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: download-release-asset
description: Download release asset from Github release
inputs:
filename:
description: Filename of asset to download
required: true
branding:
color: yellow
icon: download-cloud
runs:
using: docker
image: Dockerfile
args:
- ${{ inputs.filename }}
35 changes: 35 additions & 0 deletions .github/actions/download-release-asset/download-asset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# Modified from https://github.com/wyozi/download-gh-release-asset
#
set -e
set -o pipefail

# Ensure that the GITHUB_TOKEN secret is included
if [[ -z "${GITHUB_TOKEN}" ]]; then
echo "Set the GITHUB_TOKEN env variable."
exit 1
fi

# Ensure that the file path is present
if [[ -z "${INPUT_FILENAME}" ]]; then
echo "It seems you forgot to pass the filename of the asset to download"
exit 1
fi

FILE="${INPUT_FILENAME}"

asset_id=$(jq ".release.assets | map(select(.name == \"$FILE\"))[0].id" $GITHUB_EVENT_PATH)
if [ "$asset_id" = "null" ]; then
echo "ERROR: asset id not found"
exit 1
fi;

AUTH_HEADER="Authorization: token ${GITHUB_TOKEN}"
ASSET_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/assets/${asset_id}"

curl \
-L \
-H "${AUTH_HEADER}" \
-H "Accept:application/octet-stream" \
-o "${FILE}" \
"${ASSET_URL}"
129 changes: 129 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: CI
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
push:
tags-ignore:
- "*.*"
paths-ignore:
- "docs/**"
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3

tests:
name: ${{ matrix.runs-on }} • py${{ matrix.python }}
needs: pre-commit
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-latest
python: '3.7'
triplet: x64-linux-mixed
- runs-on: ubuntu-latest
python: '3.8'
triplet: x64-linux-mixed
- runs-on: ubuntu-latest
python: '3.9'
triplet: x64-linux-mixed
- runs-on: ubuntu-latest
python: '3.10'
triplet: x64-linux-mixed
- runs-on: ubuntu-latest
python: '3.11'
triplet: x64-linux-mixed

- runs-on: macos-latest
python: '3.7'
triplet: x64-osx-mixed
- runs-on: macos-latest
python: '3.8'
triplet: x64-osx-mixed
- runs-on: macos-latest
python: '3.9'
triplet: x64-osx-mixed
- runs-on: macos-latest
python: '3.10'
triplet: x64-osx-mixed
- runs-on: macos-latest
python: '3.11'
triplet: x64-osx-mixed

- runs-on: windows-latest
python: '3.7'
triplet: x64-windows
- runs-on: windows-latest
python: '3.8'
triplet: x64-windows
- runs-on: windows-latest
python: '3.9'
triplet: x64-windows
- runs-on: windows-latest
python: '3.10'
triplet: x64-windows
- runs-on: windows-latest
python: '3.11'
triplet: x64-windows
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install test dependencies
# TODO(jfarebro): There's a bug with Windows cmake and PEP517 builds via pip install.
# As a temporary workaround installing cmake outside of the isolated env seems to work.
run: |
python -m pip install --user --upgrade -r tests/requirements.txt
python -m pip install --user cmake

- uses: microsoft/setup-msbuild@v1.1
if: runner.os == 'Windows'
# TODO(jfarebro): 02/16/2023 - There's a bug where pkg-config isn't installed on the macOS
# runner. See: https://github.com/actions/runner-images/pull/7125
- name: Install pkg-config on macOS
if: runner.os == 'macOS'
run: brew install pkg-config
- uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: "9aa0d66373ce3a6868d12353d0d4960db0d4bd18"
# There's a permissions issue with the cache
# https://github.com/microsoft/vcpkg/issues/20121
doNotCache: true

- name: Build
run: python -m pip install --user --verbose .

- name: Test
run: python -m pytest

# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup SSH debug session on failure
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && failure() }}
with:
limit-access-to-actor: true
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
release:
types: [published]

jobs:
wheels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/download-release-asset
name: Download release wheels
with:
filename: wheels.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Unzip wheels asset
run: |
unzip wheels.zip -d dist
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
print_hash: true
122 changes: 122 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Wheels

on:
push:
tags:
- 'v*'

jobs:
build:
name: ${{ matrix.runs-on }} • ${{ matrix.arch }}
defaults:
run:
shell: bash
strategy:
matrix:
include:
- runs-on: ubuntu-latest
arch: x86_64
- runs-on: windows-latest
arch: AMD64
- runs-on: macos-latest
arch: x86_64
- runs-on: macos-latest
arch: arm64
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v2

- name: Setup Docker
if: runner.os == 'Linux'
run: docker login ghcr.io --username "${GITHUB_ACTOR}" --password "${GITHUB_CR_TOKEN}"
env:
GITHUB_CR_TOKEN: ${{ secrets.CR_TOKEN }}

- name: Setup msbuild
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v1.1

# TODO(jfarebro): 02/16/2023 - There's a bug where pkg-config isn't installed on the macOS
# runner. See: https://github.com/actions/runner-images/pull/7125
- name: Install pkg-config on macOS
if: runner.os == 'macOS'
run: brew install pkg-config

- name: Setup vcpkg
if: runner.os == 'macOS' || runner.os == 'Windows'
uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: "9aa0d66373ce3a6868d12353d0d4960db0d4bd18"
# There's a permissions issue with the cache
# https://github.com/microsoft/vcpkg/issues/20121
doNotCache: true

- name: Build wheels
uses: pypa/cibuildwheel@v2.12.0
env:
CIBW_ARCHS: "${{ matrix.arch }}"

- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: ./wheelhouse/*.whl


pypi:
name: Deploy wheels to PyPi test
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v1
with:
name: wheels

- name: Append PyPi test SHA
run: |
find wheels -type f -exec sh -c \
"mv {} \$(echo {} | awk -F\"-\" '{OFS = FS; \$2 = \$2\"+${GITHUB_SHA::7}\"; print}')" \;

- name: Publish to PyPi test
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository_url: https://test.pypi.org/legacy/
packages_dir: wheels/
print_hash: true


release:
name: Stage wheels to Github releases
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v1
with:
name: wheels

- name: Create wheel archive
run: |
zip --junk-paths wheels wheels/*

- name: Create release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: ${{ contains(github.ref, '-') }}

- name: Upload artifacts to release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wheels.zip
asset_name: wheels.zip
asset_content_type: application/zip
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ doc/examples/*Example
*.lai
*.la
*.a

# Python
*.pyc

*.egg-info/
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: debug-statements
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
Loading