Skip to content

Cleanup #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,14 @@ jobs:
timeout-minutes: 5
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install and run the checks
run: |
python -m pip install --upgrade pip
pip install -r requirements/test.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
make all
5 changes: 2 additions & 3 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
- name: Install and run the checks
run: |
python -m pip install --upgrade pip
pip install -r requirements/release.txt
make all
- name: Build and publish
env:
TWINE_USERNAME: __token__
Expand Down
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
VENV_DIR = venv
FLAKE8_COMMAND = "flake8 src/ddt.py test"

local_all: venv_test venv_flake8 venv_isort

all: test flake8

install:
python setup.py install
pip install -Ur requirements.txt

venv: venv/bin/activate

venv/bin/activate: requirements.txt
test -d venv || virtualenv venv
. venv/bin/activate; pip install -Ur requirements.txt
touch venv/bin/activate

.PHONY: test
test: install
sh -c pytest

.PHONY: venv_test
venv_test: venv
. venv/bin/activate; sh -c pytest

.PHONY: flake8
flake8: install
sh -c $(FLAKE8_COMMAND)

.PHONY: venv_flake8
venv_flake8: venv
. venv/bin/activate; sh -c $(FLAKE8_COMMAND)

.PHONY: venv_isort
venv_isort: venv
. venv/bin/activate; sh -c $(ISORT_COMMAND)

clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +

clean: clean-pyc
rm -rf $(VENV_DIR) .noseids nosetests.xml .coverage
4 changes: 0 additions & 4 deletions build.sh

This file was deleted.

6 changes: 4 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os
import sys

# Specific for readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
Expand Down Expand Up @@ -56,7 +57,8 @@
# |version| and |release|, also used in various other places throughout the
# built documents.

from ddt import __version__
from src.ddt import __version__

# The short X.Y version.
version = __version__
# The full version, including alpha/beta/rc tags.
Expand Down
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
minversion = 4.6
addopts = -ra --cov=ddt --cov-report html
testpaths =
test
2 changes: 0 additions & 2 deletions release.sh

This file was deleted.

16 changes: 16 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
codecov
coverage
enum34; python_version < '3'
flake8
isort
mock; python_version < '3.3'
pytest
pytest-cov
PyYAML
setuptools
six>=1.4.0
Sphinx
sphinxcontrib-programoutput
twine
wheel
flake8-isort==4.0.0
4 changes: 0 additions & 4 deletions requirements/build.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements/release.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements/test.txt

This file was deleted.

1 change: 0 additions & 1 deletion rtdocs.sh

This file was deleted.

7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python
# # coding: utf-8

from setuptools import setup
from ddt import __version__
from setuptools import setup, find_packages

from src.ddt import __version__

setup(
name='ddt',
Expand All @@ -12,6 +13,8 @@
author='Carles Barrobés',
author_email='[email protected]',
url='https://github.com/datadriventests/ddt',
packages=find_packages(where="src"),
package_dir={"": "src"},
py_modules=['ddt'],
classifiers=[
'Development Status :: 4 - Beta',
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions test/test_example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
from test.mycode import has_three_elements, is_a_greeting, larger_than_two

from ddt import ddt, data, file_data, unpack
from test.mycode import larger_than_two, has_three_elements, is_a_greeting
from ddt import data, ddt, file_data, unpack

try:
import yaml
Expand Down
7 changes: 4 additions & 3 deletions test/test_functional.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import json
import os
from sys import modules

import pytest
import six

Expand All @@ -9,10 +10,10 @@
except ImportError:
import mock

from ddt import ddt, data, file_data, TestNameFormat

from test.mycode import has_three_elements

from ddt import TestNameFormat, data, ddt, file_data


class CustomClass:
pass
Expand Down