Skip to content

Commit

Permalink
Add azure pipelines for Linux (#9)
Browse files Browse the repository at this point in the history
* Add azure pipelines for Linux

* Set up CI with Azure Pipelines

* Changed project structure
  • Loading branch information
marcelotrevisani committed Jan 7, 2020
1 parent 4b78e86 commit caccc60
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 27 deletions.
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]
omit =
.cache/*
tests/*
docs/*
.pytest_cache/*
setup.py

[paths]
source = grayskull
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include LICENSE
include README.rst

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
56 changes: 56 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
variables:
grayskull_deps: pytest pytest-azurepipelines pytest-xdist pytest-cov requests pyyaml

jobs:
- job: Linux
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
python38:
python.version: '3.8'
python37:
python.version: '3.7'
maxParallel: 8

steps:
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: conda update conda --yes
displayName: Update Conda version

- bash: |
conda config --add channels conda-forge
conda create --yes --name grayskull
displayName: Create Conda environment (grayskull)
- bash: |
conda config --add channels conda-forge
conda info -a
displayName: Add Conda-Forge channel
- bash: |
source activate grayskull
conda install --yes python=$PYTHON_VERSION $(grayskull_deps)
conda list
displayName: Installing dependencies
- bash: |
source activate grayskull
pytest tests \
-n auto \
--color=yes \
--cov= \
--cov-append \
--cov-report html:/tmp/grayskull/converage-html \
--cov-report xml:coverage.xml \
--cov-config=$(Build.Repository.LocalPath)/.coveragerc \
--junit-xml=junit/Linux-py${PYTHON_VERSION}.xml \
--junit-prefix=Linux-py${PYTHON_VERSION}
- task: PublishTestResults@2
inputs:
testResultsFiles: 'junit/*.xml'
condition: succeededOrFailed()
File renamed without changes.
2 changes: 0 additions & 2 deletions src/grayskull/base/__init__.py → grayskull/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import requests
import yaml

from grayskull.base.base_recipe import Grayskull # noqa


def get_valid_fields(fields):
return [
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/grayskull/pypi/pypi.py → grayskull/pypi/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import requests
from requests import HTTPError

from grayskull.base import About, Grayskull, Package, Requirements, Source, Test
from grayskull.base import About, Package, Requirements, Source, Test
from grayskull.base.base_recipe import Grayskull

log = logging.getLogger(__name__)
PyVer = namedtuple("PyVer", ["major", "minor"])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"

[tools.setuptools_scm]
write_to="src/version.py"
write_to="grayskull/version.py"
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
junit_family=xunit2
junit_duration_report=call
addopts = -ra -q
testpaths = tests
38 changes: 16 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
from setuptools import setup


def main():
setup(
name="grayskull",
packages=["grayskull", "grayskull.pypi"],
package_dir={"": "src"},
use_scm_version={"write_to": "src/grayskull/_version.py"},
setup_requires=["setuptools-scm>=3.4", "setuptools>=42.0"],
install_requires=["requests", "pyyaml"],
extras_require={"testing": ["pytest"]},
url="https://github.com/marcelotrevisani/grayskull",
license="MIT",
author="Marcelo Duarte Trevisani",
author_email="marceloduartetrevisani@gmail.com",
description="Skeletor's main goal is to conquer the mysterious fortress of"
" Castle Grayskull. If he succeeds, Skeletor would be able to conquer not"
" only Eternia, but the whole universe.",
)


if __name__ == "__main__":
main()
setup(
name="grayskull",
version="0.1.0",
packages=["grayskull", "grayskull.base", "grayskull.pypi"],
use_scm_version={"write_to": "grayskull/_version.py"},
setup_requires=["setuptools-scm>=3.4", "setuptools>=40.0"],
install_requires=["requests", "pyyaml"],
extras_require={"testing": ["pytest"]},
url="https://github.com/marcelotrevisani/grayskull",
license="MIT",
author="Marcelo Duarte Trevisani",
author_email="marceloduartetrevisani@gmail.com",
description="Skeletor's main goal is to conquer the mysterious fortress of"
" Castle Grayskull. If he succeeds, Skeletor would be able to conquer not"
" only Eternia, but the whole universe.",
)
3 changes: 2 additions & 1 deletion tests/test_base_recipe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest

from grayskull.base import Extra, Grayskull, Package
from grayskull.base import Extra, Package
from grayskull.base.base_recipe import Grayskull


class EmptyGray(Grayskull):
Expand Down

0 comments on commit caccc60

Please sign in to comment.