Skip to content
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

Removed test from setup.py + Replaced all direct setup.py #412

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,21 @@ jobs:

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest==7.4.4 coverage coveralls pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build adslib
run: |
python setup.py build
- name: Install package
run: |
python setup.py develop
pip install .
- name: Test with pytest
run: |
pytest -v --cov pyads
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist
python -m build sdist
twine upload dist/*
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# This Dockerfile is for running the tests on a windows system where the
# TwinCat router can interfere with the tests. In the first instance tests should be run with tox.

ARG python_version=3.8
ARG python_version=3.12

# Build python environment and setup pyads
FROM python:${python_version}
COPY . /pyads
WORKDIR /pyads
RUN python setup.py build
RUN python setup.py develop
RUN python -m pip install .

# Test commands
RUN pip install pytest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ From source:
```bash
git clone https://github.com/stlehmann/pyads.git --recursive
cd pyads
python setup.py install
pip install .
```

## Features
Expand Down
22 changes: 0 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import functools
import operator
from setuptools import setup
from setuptools.command.test import test as TestCommand
from setuptools.command.install import install as _install
from distutils.command.build import build as _build
from distutils.command.clean import clean as _clean
Expand Down Expand Up @@ -118,27 +117,7 @@ def run(self):
_install.run(self)


class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ['--cov-report', 'html', '--cov-report', 'term',
'--cov=pyads']

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)


cmdclass = {
'test': PyTest,
'build': build,
'clean': clean,
'sdist': sdist,
Expand Down Expand Up @@ -177,6 +156,5 @@ def run_tests(self):
],
cmdclass=cmdclass,
data_files=data_files,
tests_require=['pytest', 'pytest-cov'],
has_ext_modules=lambda: True,
)