1
0
mirror of https://github.com/gryf/fs-uae-wrapper.git synced 2025-12-18 03:50:28 +01:00

Move from travis to gh actions

This commit is contained in:
2024-09-13 21:27:40 +02:00
parent bd0aa3dee4
commit 8d8d38d5c0
7 changed files with 9 additions and 56 deletions

View File

@@ -1,33 +0,0 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest tox coverage pytest-cov pytest-pep8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
tox

View File

@@ -1,11 +0,0 @@
language: python
env:
- TOXENV=py27
- TOXENV=py27-flake8
- TOXENV=py3
- TOXENV=py3-flake8
install: pip install tox
script: tox
before_install:
- sudo apt-get update
- sudo apt-get install -y python-tk python3-tk

View File

@@ -2,8 +2,8 @@
FS-UAE Wrapper FS-UAE Wrapper
============== ==============
.. image:: https://travis-ci.org/gryf/fs-uae-wrapper.svg?branch=master .. image:: https://github.com/gryf/fs-uae-wrapper/workflows/Test/badge.svg?event=push&branch=master
:target: https://travis-ci.org/gryf/fs-uae-wrapper :target: https://github.com/gryf/fs-uae-wrapper/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster
.. image:: https://img.shields.io/pypi/v/fs-uae-wrapper.svg .. image:: https://img.shields.io/pypi/v/fs-uae-wrapper.svg
:target: https://pypi.python.org/pypi/fs-uae-wrapper :target: https://pypi.python.org/pypi/fs-uae-wrapper

View File

@@ -4,7 +4,6 @@ Base class for all wrapper modules
import logging import logging
import os import os
import shutil import shutil
import sys
import tempfile import tempfile
from fs_uae_wrapper import utils from fs_uae_wrapper import utils
@@ -325,6 +324,6 @@ class ArchiveBase(Base):
for ext in ('.7z', '.lha', '.lzx', '.zip', '.rar', '.tar', '.tgz', for ext in ('.7z', '.lha', '.lzx', '.zip', '.rar', '.tar', '.tgz',
'.tar.gz', '.tar.bz2', '.tar.xz'): '.tar.gz', '.tar.bz2', '.tar.xz'):
if ((basename + ext).lower() == fname.lower() and if ((basename + ext).lower() == fname.lower() and
basename == os.path.splitext(fname)[0]): basename == os.path.splitext(fname)[0]):
return fname return fname
return None return None

View File

@@ -20,7 +20,7 @@ class MessageGui(tkinter.Tk):
# Display window without decorations # Display window without decorations
self.wm_attributes('-type', 'splash') self.wm_attributes('-type', 'splash')
self.frame = ttk.Frame(self, padding=5, borderwidth=0) self.frame = tkinter.ttk.Frame(self, padding=5, borderwidth=0)
self.frame.grid() self.frame.grid()
tkinter.ttk.Label(self.frame, text=msg, relief="ridge", tkinter.ttk.Label(self.frame, text=msg, relief="ridge",
padding=10).grid() padding=10).grid()

View File

@@ -5,7 +5,6 @@ It will use compressed base image and compressed directories.
""" """
import logging import logging
import os import os
import shutil
from fs_uae_wrapper import base from fs_uae_wrapper import base
from fs_uae_wrapper import utils from fs_uae_wrapper import utils
@@ -62,7 +61,6 @@ class Wrapper(base.ArchiveBase):
"location.", base_image) "location.", base_image)
return False return False
title = self._get_title()
curdir = os.path.abspath('.') curdir = os.path.abspath('.')
os.chdir(self.dir) os.chdir(self.dir)
result = utils.extract_archive(base_image) result = utils.extract_archive(base_image)
@@ -97,8 +95,8 @@ class Wrapper(base.ArchiveBase):
icon_fname = None icon_fname = None
for fname in os.listdir(slave_path): for fname in os.listdir(slave_path):
if (fname.lower().endswith('.info') and if (fname.lower().endswith('.info') and
os.path.splitext(slave_fname)[0].lower() == os.path.splitext(slave_fname)[0].lower() ==
os.path.splitext(fname)[0].lower()): os.path.splitext(fname)[0].lower()):
icon_fname = fname icon_fname = fname
break break
if icon_fname is None: if icon_fname is None:

View File

@@ -163,7 +163,7 @@ class TestWHDLoad(TestCase):
@mock.patch('os.chdir') @mock.patch('os.chdir')
def test_find_slave_no_slave_file(self, chdir, walk): def test_find_slave_no_slave_file(self, chdir, walk):
walk.return_value = [(".", ('game'), ()), walk.return_value = [(".", ('game'), ()),
('./game', (), ('foo', 'bar', 'baz'))] ('./game', (), ('foo', 'bar', 'baz'))]
wrapper = whdload.Wrapper('Config.fs-uae', utils.CmdOption(), {}) wrapper = whdload.Wrapper('Config.fs-uae', utils.CmdOption(), {})
self.assertFalse(wrapper._find_slave()) self.assertFalse(wrapper._find_slave())
@@ -173,7 +173,7 @@ class TestWHDLoad(TestCase):
def test_find_slave_no_corresponding_icon(self, chdir, walk, listdir): def test_find_slave_no_corresponding_icon(self, chdir, walk, listdir):
contents = ('foo', 'bar', 'baz.slave') contents = ('foo', 'bar', 'baz.slave')
walk.return_value = [(".", ('game'), ()), walk.return_value = [(".", ('game'), ()),
('./game', (), contents)] ('./game', (), contents)]
listdir.return_value = contents listdir.return_value = contents
wrapper = whdload.Wrapper('Config.fs-uae', utils.CmdOption(), {}) wrapper = whdload.Wrapper('Config.fs-uae', utils.CmdOption(), {})
self.assertFalse(wrapper._find_slave()) self.assertFalse(wrapper._find_slave())
@@ -185,7 +185,7 @@ class TestWHDLoad(TestCase):
def test_find_slave_success(self, chdir, walk, listdir, bopen): def test_find_slave_success(self, chdir, walk, listdir, bopen):
contents = ('foo', 'bar', 'baz.slave', 'baz.info') contents = ('foo', 'bar', 'baz.slave', 'baz.info')
walk.return_value = [(".", ('game'), ()), walk.return_value = [(".", ('game'), ()),
('./game', (), contents)] ('./game', (), contents)]
listdir.return_value = contents listdir.return_value = contents
wrapper = whdload.Wrapper('Config.fs-uae', utils.CmdOption(), {}) wrapper = whdload.Wrapper('Config.fs-uae', utils.CmdOption(), {})
self.assertTrue(wrapper._find_slave()) self.assertTrue(wrapper._find_slave())