Skip to content

Commit

Permalink
Replaced travis com github actions (#28)
Browse files Browse the repository at this point in the history
* Replace travis with github actions
* Replace imp with importlib

Co-authored-by: Raphael Vieira Rossi <[email protected]>
  • Loading branch information
marcelometal and RaphaelVRossi authored Oct 9, 2023
1 parent 781c878 commit 67e7f98
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 16 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: unittests
on:
push:
pull_request:
types: [opened, reopened]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set up Python
id: setup-python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install -y librtmp-dev libevent-dev
python -m pip install --upgrade pip
make setup
- name: Test with pyvows
run: make test
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

8 changes: 5 additions & 3 deletions derpconf/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import logging
from collections import defaultdict
from os.path import join, exists, abspath, dirname, isdir
import imp
import importlib

import six
from textwrap import fill
Expand Down Expand Up @@ -94,7 +94,8 @@ def __load_from_path(cls, conf, path):
with open(path) as config_file:
name = 'configuration'
code = config_file.read()
module = imp.new_module(name)
spec = importlib._bootstrap.ModuleSpec(name, None)
module = importlib.util.module_from_spec(spec)

six.exec_(code, module.__dict__)

Expand All @@ -118,7 +119,8 @@ def verify(cls, path):
with open(path) as config_file:
name = 'configuration'
code = config_file.read()
module = imp.new_module(name)
spec = importlib._bootstrap.ModuleSpec(name, None)
module = importlib.util.module_from_spec(spec)

six.exec_(code, module.__dict__)

Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def run_setup(extension_modules=[]):
'Natural Language :: English',
'Operating System :: MacOS',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
packages=['derpconf'],
package_dir={"derpconf": "derpconf"},
Expand Down

0 comments on commit 67e7f98

Please sign in to comment.