diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..62ddfec --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: Build binaries + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + linux-elf: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: sudo apt-get install libsdl2-2.0-0 + - run: python -m pip install pyinstaller + - run: python -m pip install --find-links ${WHEELS} wxPython + env: + WHEELS: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 + - run: python setup.py clean bundle + - uses: actions/upload-artifact@v2 + with: + name: PythonTurtle + path: ${{ github.workspace }}/dist/PythonTurtle + + macos-app: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: python -m pip install pyinstaller wxPython + - run: python setup.py clean bundle + - run: rm ${{ github.workspace }}/dist/PythonTurtle + - uses: actions/upload-artifact@v2 + with: + name: PythonTurtle.app + path: ${{ github.workspace }}/dist/ + + windows-exe: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: python -m pip install pyinstaller wxPython + - run: python setup.py clean bundle + - uses: actions/upload-artifact@v2 + with: + name: PythonTurtle.exe + path: ${{ github.workspace }}\dist\PythonTurtle.exe diff --git a/.github/workflows/build_linux_elf.yml b/.github/workflows/build_linux_elf.yml deleted file mode 100644 index 541a023..0000000 --- a/.github/workflows/build_linux_elf.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build Linux ELF - -on: - push: - tags: - - "*" - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - run: sudo apt-get install libsdl2-2.0-0 - - run: python -m pip install pyinstaller - - run: python setup.py clean bundle - - uses: actions/upload-artifact@v2 - with: - name: PythonTurtle for Linux - path: /home/runner/work/PythonTurtle/PythonTurtle/dist/PythonTurtle diff --git a/.github/workflows/build_windows_exe.yml b/.github/workflows/build_windows_exe.yml deleted file mode 100644 index 31e08b3..0000000 --- a/.github/workflows/build_windows_exe.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Build Windows exe - -on: - push: - tags: - - "*" - -jobs: - build: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - run: python -m pip install pyinstaller - - run: python setup.py clean bundle - - uses: actions/upload-artifact@v2 - with: - name: PythonTurtle for Windows - path: D:\a\PythonTurtle\PythonTurtle\dist\PythonTurtle.exe diff --git a/.github/workflows/checks.yml b/.github/workflows/check.yml similarity index 80% rename from .github/workflows/checks.yml rename to .github/workflows/check.yml index 6ddebc0..4b207e7 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/check.yml @@ -2,9 +2,11 @@ name: Checks on: pull_request: - branches: [master] + branches: + - master push: - branches: [master] + branches: + - master jobs: build: @@ -12,7 +14,9 @@ jobs: strategy: fail-fast: false matrix: - env: [flake8, pylint] + env: + - flake8 + - pylint steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 diff --git a/.github/workflows/packaging.yml b/.github/workflows/publish.yml similarity index 80% rename from .github/workflows/packaging.yml rename to .github/workflows/publish.yml index 3428c18..875e451 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Publish Python package +name: Publish binaries and Python package on: push: @@ -6,7 +6,12 @@ on: - "*" jobs: - deploy: + binaries: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + pypi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/test.yml similarity index 72% rename from .github/workflows/tests.yml rename to .github/workflows/test.yml index 4200cf8..0601295 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,11 @@ name: Tests on: pull_request: - branches: [master] + branches: + - master push: - branches: [master] + branches: + - master jobs: build: @@ -12,16 +14,22 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.6, 3.7, 3.8] + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: + - '3.6' + - '3.7' + - '3.8' steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies for Ubuntu - run: sudo apt-get install libsdl2-2.0-0 if: matrix.os == 'ubuntu-latest' + run: sudo apt-get install libsdl2-2.0-0 - name: Install prerequisites run: python -m pip install --upgrade setuptools pip wheel tox-gh-actions - name: Run tests diff --git a/README.md b/README.md index d01b782..609b454 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -Python Turtle -============= +# PythonTurtle [![Travis CI](https://img.shields.io/travis/PythonTurtle/PythonTurtle/master.svg?logo=travis)](https://travis-ci.org/PythonTurtle/PythonTurtle ) [![AppVeyor](https://img.shields.io/appveyor/ci/cool-RR/PythonTurtle/master.svg?logo=appveyor)](https://ci.appveyor.com/project/cool-RR/PythonTurtle @@ -16,8 +15,7 @@ Inspired by LOGO. Homepage: [http://pythonturtle.org](http://pythonturtle.org) -An Appealing Environment to Learn Python ----------------------------------------- +## An Appealing Environment to Learn Python PythonTurtle strives to provide the lowest-threshold way to learn Python. Students command an interactive Python shell (similar to the [IDLE development @@ -31,8 +29,7 @@ to students. ![Screen shot](http://pythonturtle.org/images/screenshot.gif) -Installation ------------- +## Installation Installers for Microsoft Windows and macOS are available from [pythonturtle.org](http://pythonturtle.org) and [GitHub]( @@ -62,20 +59,20 @@ If you're into automation: [Ansible tasks](https://github.com/painless-software/ansible-role-software/blob/master/tasks/education/programming.yml#L12-L43 ) for setting up PythonTurtle including a desktop shortcut for GNOME. -### Troubleshooting +## Troubleshooting > ImportError: libpng12.so.0: cannot open shared object file: No such file or directory See https://askubuntu.com/a/978338/14650 -Compatibility -------------- + +## Compatibility Tested with Python version 3.6 and wxPython version 4.0.1. Reported to run on Windows, macOS, Ubuntu Linux, and Fedora. -Development ------------ + +## Development ```bash git clone https://github.com/PythonTurtle/PythonTurtle.git @@ -92,10 +89,28 @@ python3 setup.py clean bundle Please [open a pull request](https://github.com/PythonTurtle/PythonTurtle/pulls ) for contributions or bug fixes. If you can, please also add tests. -About ------ + + +## Citing PythonTurtle + +If you refer to PythonTurtle in academic work, please use this citation format: + +```bibtex +@misc{rachum2009pythonturtle, + author={Rachum, Ram and Bittner, Peter and others}, + title={PythonTurtle: A learning environment for Python suited for beginners and children, inspired by Logo}, + month={may}, + year={2009}, + publisher={GitHub}, + doi={10.5281/zenodo.10465283}, + url={https://github.com/PythonTurtle/PythonTurtle/} +} +``` + + +## License This project is licensed under the MIT license. -PythonTurtle was created by Ram Rachum as a side-project in 2009. I also provide -[freelance Django/Python development services](https://chipmunkdev.com). I [give Python workshops](http://pythonworkshops.co/) to teach people Python and related topics. ([Hebrew website](http://pythonworkshops.co.il/).) + + diff --git a/setup.py b/setup.py index 1cf655d..9955f00 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ def run(): """ Create an application bundle (using PyInstaller) """ - import PyInstaller.__main__ + import PyInstaller.__main__ # pylint: disable=import-outside-toplevel resources_folder = os.path.join('pythonturtle', 'resources') @@ -50,8 +50,8 @@ def include_resources(file_glob): '--name=%s' % package.name, '--onefile', '--windowed', - '--add-binary=%s' % include_resources('*.ic*'), - '--add-binary=%s' % include_resources('*.png'), + '--add-data=%s' % include_resources('*.ic*'), + '--add-data=%s' % include_resources('*.png'), '--add-data=%s' % include_resources('*.txt'), '--icon=%s' % resource_path('icon.ico'), os.path.join('pythonturtle', '__main__.py'), diff --git a/tox.ini b/tox.ini index 55cbb97..1679188 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # - Installing wxPython is non-trivial on GNU/Linux. We need to install wheels from a dedicated repository, # located at https://extras.wxpython.org/wxPython4/extras/linux/. For beackground reading see # https://wiki.wxpython.org/How%20to%20install%20wxPython#Installing_wxPython-Phoenix_using_pip -# - The wheel repository specified via --find-links below matches the build environment on Travis CI. +# - The wheel repository specified via --find-links below matches the build environment on GitHub Actions. # - For local Tox runs adapt the wheel repository URLs to match your local environment. [tox] @@ -25,7 +25,6 @@ commands = [testenv:flake8] description = Static code analysis and code style -basepython = python3.6 deps = flake8 commands = @@ -33,10 +32,8 @@ commands = [testenv:pylint] description = Check for errors and code smells -basepython = python3.6 deps = - astroid<2.2 - pylint<2.4 + pylint pyinstaller commands = {envpython} -m pip install --find-links https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 wxPython