Skip to content

Commit

Permalink
init(hui-python): new temp cd
Browse files Browse the repository at this point in the history
init(hui-python): new temp cd

init(hui-python): new temp cd

init(hui-python): new temp cd

init(hui-python): new temp cd

init(hui-python): new temp cd

init(hui-python): new temp cd

init(hui-python): new temp cd

init(hui-python): new temp cd

init(hui-python): new temp cd

init(hui-python): new temp cd

docs: auto update index.rst

init(hui-python): new temp cd

init(hui-python): new temp cd
  • Loading branch information
maxblan authored and maxblan committed Jun 4, 2024
1 parent 768068b commit 6ddd41e
Show file tree
Hide file tree
Showing 2 changed files with 168 additions and 44 deletions.
112 changes: 112 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Continuous Deployment
'on':
push:
tags:
- '*'
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64
- x86
- aarch64
- armv7
- s390x
- ppc64le
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: '${{ matrix.target }}'
args: '--release --out dist --find-interpreter'
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
windows:
runs-on: windows-latest
strategy:
matrix:
target:
- x64
- x86
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: '${{ matrix.target }}'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: '${{ matrix.target }}'
args: '--release --out dist --find-interpreter'
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
macos:
runs-on: macos-latest
strategy:
matrix:
target:
- x86_64
- aarch64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: '${{ matrix.target }}'
args: '--release --out dist --find-interpreter'
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
release:
permissions: write-all
name: Release
runs-on: ubuntu-latest
if: 'startsWith(github.ref, ''refs/tags/'')'
needs:
- macos
- windows
- linux
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
tag_name: '${{ github.ref }}'
release_name: 'Release ${{ github.ref }}'
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
if: startsWith(github.ref, 'refs/tags/')
with:
files: '*.whl'
100 changes: 56 additions & 44 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
.. raw:: html

<!-- trunk-ignore-all(markdownlint/MD041) -->

Python Client for the Software-Challenge Germany 2024
=====================================================

|Read the Docs| |PyPI| |PyPI - Python Version| |Discord| |Documentation|

**Be warned!** This package is currently experimental and has still a
few known bugs. But please try it out and let us know if anything
comes up.

..
Hey there! To help you out, it's best to start by checking out the
`documentation for this
client <https://socha-python-client.readthedocs.io/en/>`__ before you
ask any questions or open an issue. It'll provide you with some
helpful information!
This package is currently in early stage of development!

This repository contains the Python package for the `Software-Challenge
Germany <https://www.software-challenge.de>`__, a programming
competition for students. The students have to develop an artificial
intelligence that plays and competes against other opponents in an
annually changing game.

This year it is the game `Mississippi
Queen <https://docs.software-challenge.de/spiele/mississippi-queen>`__.
This year it is the game `Hase und Igel <>`__.

Table of Contents
-----------------
Expand Down Expand Up @@ -59,6 +52,13 @@ presented, which installs the packages inside the folder.
- Debian: ``$ sudo apt install python3.10``
- Arch: ``$ sudo pacman -S python``

..
In some rare cases there maybe a `broken or missing installation of
``setuptools`` <https://github.com/maxblan/socha-python-client/issues/40>`__.
If this is the case on your machine you can install it again with
``pip install -I setuptools``.

Globally
~~~~~~~~

Expand Down Expand Up @@ -180,39 +180,50 @@ start arguments.
Note that any arguments passed as startup parameters will override
those in the code, including the ones you set yourself.

+-----------------------+---------------------------------------------+
| **Command** | **Description** |
+=======================+=============================================+
| **--help** | Prints the help message. |
+-----------------------+---------------------------------------------+
| **-h, --host** | The host to connect to. The default is |
| | 'localhost'. |
+-----------------------+---------------------------------------------+
| **-p, --port** | The port of the host. The default is 13050. |
+-----------------------+---------------------------------------------+
| **-r, --reservation** | Reservation code for a prepared game. |
+-----------------------+---------------------------------------------+
| **-R, --room** | Room Id the client will try to connect. |
+-----------------------+---------------------------------------------+
| **-s, --survive** | If present, the client will keep running, |
| | even if the connection to the server is |
| | terminated. |
+-----------------------+---------------------------------------------+
| **-l, --log** | If present, the client will write a log |
| | file to the current directory. |
+-----------------------+---------------------------------------------+
| **-v, --verbose** | Verbose option for logging. |
+-----------------------+---------------------------------------------+
| **--auto-reconnect** | Automatically reconnect to the server if |
| | the connection is lost. |
+-----------------------+---------------------------------------------+
| **-b, --build** | Builds this script into a package with all |
| | its dependencies. |
+-----------------------+---------------------------------------------+
+------------------------+--------------------------------------------+
| **Command** | **Description** |
+========================+============================================+
| **--help** | Prints the help message. |
+------------------------+--------------------------------------------+
| **-h, --host** | The host to connect to. The default is |
| | 'localhost'. |
+------------------------+--------------------------------------------+
| **-p, --port** | The port of the host. The default is |
| | 13050. |
+------------------------+--------------------------------------------+
| **-r, --reservation** | Reservation code for a prepared game. |
+------------------------+--------------------------------------------+
| **-R, --room** | Room Id the client will try to connect. |
+------------------------+--------------------------------------------+
| **-s, --survive** | If present, the client will keep running, |
| | even if the connection to the server is |
| | terminated. |
+------------------------+--------------------------------------------+
| **-l, --log** | If present, the client will write a log |
| | file to the current directory. |
+------------------------+--------------------------------------------+
| **-v, --verbose** | Verbose option for logging. |
+------------------------+--------------------------------------------+
| **--auto-reconnect** | Automatically reconnect to the server if |
| | the connection is lost. |
+------------------------+--------------------------------------------+
| **-b, --build** | Builds this script into a package with all |
| | its dependencies. |
+------------------------+--------------------------------------------+
| **-d, --directory** | The directory where the package should be |
| | built. |
+------------------------+--------------------------------------------+
| **-a, --architecture** | The architecture of the package. |
+------------------------+--------------------------------------------+

Preparing Your Player for the Competition
-----------------------------------------

Please note that the competition system runs on a Linux system with
an ``x86_64`` architecture. To use your client on the competition
system, you will need to download the socha package built for the
``manylinux2014_x86_64`` platform and the Python version ``310``.

To ensure that your player is usable for the competition system, you
need to download all the dependencies that your client uses because the
system will run on a docker container without access to the internet and
Expand All @@ -223,7 +234,7 @@ sudo permission.
file that lists all your dependencies. To start, simply run the
following command in your terminal:

``$ python <your_main_script>.py --build <your_directory_name>``
``$ python <your_main_script>.py --build -directory <your_directory_name> -architecture <target architecture>``

This will trigger the package to do its magic and build your project.

Expand All @@ -235,7 +246,8 @@ dependencies:
2. Type ``mkdir my_player`` to create a new directory named
``my_player``. You can name yours whatever you want.
3. Enter the directory using ``cd my_player``.
4. Run the command: ``pip download socha xsdata==22.7 -d dependencies``
4. Run the command:
``pip download socha --only-binary=:all: --platform manylinux2014_x86_64 --python-version 310 -d dependencies``
in the directory. This command downloads the dependencies you need
into the folder ``dependencies``.
5. Ensure to add all your dependencies that your client uses.
Expand Down

0 comments on commit 6ddd41e

Please sign in to comment.