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:
33
.github/workflows/python-app.yml
vendored
33
.github/workflows/python-app.yml
vendored
@@ -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
|
||||
11
.travis.yml
11
.travis.yml
@@ -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
|
||||
@@ -2,8 +2,8 @@
|
||||
FS-UAE Wrapper
|
||||
==============
|
||||
|
||||
.. image:: https://travis-ci.org/gryf/fs-uae-wrapper.svg?branch=master
|
||||
:target: https://travis-ci.org/gryf/fs-uae-wrapper
|
||||
.. image:: https://github.com/gryf/fs-uae-wrapper/workflows/Test/badge.svg?event=push&branch=master
|
||||
: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
|
||||
:target: https://pypi.python.org/pypi/fs-uae-wrapper
|
||||
|
||||
@@ -4,7 +4,6 @@ Base class for all wrapper modules
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
from fs_uae_wrapper import utils
|
||||
@@ -325,6 +324,6 @@ class ArchiveBase(Base):
|
||||
for ext in ('.7z', '.lha', '.lzx', '.zip', '.rar', '.tar', '.tgz',
|
||||
'.tar.gz', '.tar.bz2', '.tar.xz'):
|
||||
if ((basename + ext).lower() == fname.lower() and
|
||||
basename == os.path.splitext(fname)[0]):
|
||||
basename == os.path.splitext(fname)[0]):
|
||||
return fname
|
||||
return None
|
||||
|
||||
@@ -20,7 +20,7 @@ class MessageGui(tkinter.Tk):
|
||||
# Display window without decorations
|
||||
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()
|
||||
tkinter.ttk.Label(self.frame, text=msg, relief="ridge",
|
||||
padding=10).grid()
|
||||
|
||||
@@ -5,7 +5,6 @@ It will use compressed base image and compressed directories.
|
||||
"""
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from fs_uae_wrapper import base
|
||||
from fs_uae_wrapper import utils
|
||||
@@ -62,7 +61,6 @@ class Wrapper(base.ArchiveBase):
|
||||
"location.", base_image)
|
||||
return False
|
||||
|
||||
title = self._get_title()
|
||||
curdir = os.path.abspath('.')
|
||||
os.chdir(self.dir)
|
||||
result = utils.extract_archive(base_image)
|
||||
@@ -97,8 +95,8 @@ class Wrapper(base.ArchiveBase):
|
||||
icon_fname = None
|
||||
for fname in os.listdir(slave_path):
|
||||
if (fname.lower().endswith('.info') and
|
||||
os.path.splitext(slave_fname)[0].lower() ==
|
||||
os.path.splitext(fname)[0].lower()):
|
||||
os.path.splitext(slave_fname)[0].lower() ==
|
||||
os.path.splitext(fname)[0].lower()):
|
||||
icon_fname = fname
|
||||
break
|
||||
if icon_fname is None:
|
||||
|
||||
@@ -163,7 +163,7 @@ class TestWHDLoad(TestCase):
|
||||
@mock.patch('os.chdir')
|
||||
def test_find_slave_no_slave_file(self, chdir, walk):
|
||||
walk.return_value = [(".", ('game'), ()),
|
||||
('./game', (), ('foo', 'bar', 'baz'))]
|
||||
('./game', (), ('foo', 'bar', 'baz'))]
|
||||
wrapper = whdload.Wrapper('Config.fs-uae', utils.CmdOption(), {})
|
||||
self.assertFalse(wrapper._find_slave())
|
||||
|
||||
@@ -173,7 +173,7 @@ class TestWHDLoad(TestCase):
|
||||
def test_find_slave_no_corresponding_icon(self, chdir, walk, listdir):
|
||||
contents = ('foo', 'bar', 'baz.slave')
|
||||
walk.return_value = [(".", ('game'), ()),
|
||||
('./game', (), contents)]
|
||||
('./game', (), contents)]
|
||||
listdir.return_value = contents
|
||||
wrapper = whdload.Wrapper('Config.fs-uae', utils.CmdOption(), {})
|
||||
self.assertFalse(wrapper._find_slave())
|
||||
@@ -185,7 +185,7 @@ class TestWHDLoad(TestCase):
|
||||
def test_find_slave_success(self, chdir, walk, listdir, bopen):
|
||||
contents = ('foo', 'bar', 'baz.slave', 'baz.info')
|
||||
walk.return_value = [(".", ('game'), ()),
|
||||
('./game', (), contents)]
|
||||
('./game', (), contents)]
|
||||
listdir.return_value = contents
|
||||
wrapper = whdload.Wrapper('Config.fs-uae', utils.CmdOption(), {})
|
||||
self.assertTrue(wrapper._find_slave())
|
||||
|
||||
Reference in New Issue
Block a user