kopia lustrzana https://gitlab.com/gerbolyze/gerbonara
rodzic
77f2da8761
commit
0d21c171d3
108
.gitlab-ci.yml
108
.gitlab-ci.yml
|
@ -1,80 +1,48 @@
|
||||||
stages:
|
|
||||||
- test
|
|
||||||
- coverage
|
|
||||||
- build
|
|
||||||
- upload
|
|
||||||
|
|
||||||
image: python:3-alpine
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
TWINE_NON_INTERACTIVE: "true"
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
CONFIG_FILE: ".pypirc"
|
|
||||||
|
|
||||||
cache:
|
stages:
|
||||||
paths:
|
- build
|
||||||
- .pipcache/
|
- test
|
||||||
|
- publish
|
||||||
|
|
||||||
before_script:
|
build:debian_10:
|
||||||
- apk --no-cache add make
|
stage: build
|
||||||
- pip --cache-dir .pipcache install -r test-requirements.txt
|
image: "registry.gitlab.com/gerbolyze/build-containers/debian:10"
|
||||||
- cat /etc/alpine-release
|
variables:
|
||||||
- python -V
|
GIT_SUBMODULE_STRATEGY: none
|
||||||
|
script:
|
||||||
|
- python3 setup.py bdist_wheel
|
||||||
|
artifacts:
|
||||||
|
name: "gerbolyze-$CI_COMMIT_REF_NAME-gerbonara"
|
||||||
|
paths:
|
||||||
|
- dist/*.whl
|
||||||
|
|
||||||
.test:
|
test:debian_10:
|
||||||
stage: test
|
stage: test
|
||||||
|
image: "registry.gitlab.com/gerbolyze/build-containers/debian:10"
|
||||||
script:
|
script:
|
||||||
- make test
|
- "pytest -o 'testpaths=gerbonara/tests' -o 'norecursedirs=*'"
|
||||||
|
dependencies:
|
||||||
|
- build:debian_10
|
||||||
|
artifacts:
|
||||||
|
name: "gerbolyze-$CI_COMMIT_REF_NAME-gerbonara"
|
||||||
|
when: on_failure
|
||||||
|
paths:
|
||||||
|
- gerbonara_test_failures/*
|
||||||
|
|
||||||
test:3.6:
|
publish:gerbonara:
|
||||||
extends: .test
|
stage: publish
|
||||||
image: python:3.6-alpine
|
variables:
|
||||||
|
GIT_SUBMODULE_STRATEGY: none
|
||||||
test:3.7:
|
image: "registry.gitlab.com/gerbolyze/build-containers/debian:10"
|
||||||
extends: .test
|
cache: {}
|
||||||
image: python:3.7-alpine
|
|
||||||
|
|
||||||
test:3.8:
|
|
||||||
extends: .test
|
|
||||||
image: python:3.8-alpine
|
|
||||||
|
|
||||||
test:3.9:
|
|
||||||
extends: .test
|
|
||||||
image: python:3.9-alpine
|
|
||||||
|
|
||||||
# 3.10
|
|
||||||
test:rc:
|
|
||||||
extends: .test
|
|
||||||
allow_failure: true
|
|
||||||
image: python:rc-alpine
|
|
||||||
|
|
||||||
testpypi:
|
|
||||||
stage: upload
|
|
||||||
script:
|
script:
|
||||||
- pip --cache-dir .pipcache install twine
|
- pip install -U --user twine
|
||||||
- python setup.py sdist bdist_wheel
|
- export TWINE_USERNAME TWINE_PASSWORD
|
||||||
- twine upload --skip-existing --repository testpypi dist/*
|
- ~/.local/bin/twine upload dist/*
|
||||||
|
dependencies:
|
||||||
|
- build:debian_10
|
||||||
only:
|
only:
|
||||||
- master
|
- /^v.*$/
|
||||||
|
|
||||||
pypi:
|
|
||||||
stage: upload
|
|
||||||
script:
|
|
||||||
- pip --cache-dir .pipcache install twine
|
|
||||||
- python setup.py sdist bdist_wheel
|
|
||||||
- twine upload --skip-existing --repository pypi dist/*
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
|
|
||||||
aur_git:
|
|
||||||
stage: upload
|
|
||||||
script:
|
|
||||||
- echo "build pygerber-git"
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
|
|
||||||
aur:
|
|
||||||
stage: upload
|
|
||||||
script:
|
|
||||||
- echo "build pygerber"
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
|
|
|
@ -32,13 +32,6 @@ def test_zero_suppression():
|
||||||
("10000", 0.1),
|
("10000", 0.1),
|
||||||
("100000", 1.0),
|
("100000", 1.0),
|
||||||
("1000000", 10.0),
|
("1000000", 10.0),
|
||||||
("-1", -0.00001),
|
|
||||||
("-10", -0.0001),
|
|
||||||
("-100", -0.001),
|
|
||||||
("-1000", -0.01),
|
|
||||||
("-10000", -0.1),
|
|
||||||
("-100000", -1.0),
|
|
||||||
("-1000000", -10.0),
|
|
||||||
("0", 0.0),
|
("0", 0.0),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -57,13 +50,6 @@ def test_zero_suppression():
|
||||||
("00001", 0.001),
|
("00001", 0.001),
|
||||||
("000001", 0.0001),
|
("000001", 0.0001),
|
||||||
("0000001", 0.00001),
|
("0000001", 0.00001),
|
||||||
("-1", -10.0),
|
|
||||||
("-01", -1.0),
|
|
||||||
("-001", -0.1),
|
|
||||||
("-0001", -0.01),
|
|
||||||
("-00001", -0.001),
|
|
||||||
("-000001", -0.0001),
|
|
||||||
("-0000001", -0.00001),
|
|
||||||
("0", 0.0),
|
("0", 0.0),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -83,13 +69,6 @@ def test_format():
|
||||||
((2, 3), "1", 0.001),
|
((2, 3), "1", 0.001),
|
||||||
((2, 2), "1", 0.01),
|
((2, 2), "1", 0.01),
|
||||||
((2, 1), "1", 0.1),
|
((2, 1), "1", 0.1),
|
||||||
((2, 7), "-1", -0.0000001),
|
|
||||||
((2, 6), "-1", -0.000001),
|
|
||||||
((2, 5), "-1", -0.00001),
|
|
||||||
((2, 4), "-1", -0.0001),
|
|
||||||
((2, 3), "-1", -0.001),
|
|
||||||
((2, 2), "-1", -0.01),
|
|
||||||
((2, 1), "-1", -0.1),
|
|
||||||
((2, 6), "0", 0),
|
((2, 6), "0", 0),
|
||||||
]
|
]
|
||||||
for fmt, string, value in test_cases:
|
for fmt, string, value in test_cases:
|
||||||
|
@ -104,12 +83,6 @@ def test_format():
|
||||||
((3, 5), "1", 100.0),
|
((3, 5), "1", 100.0),
|
||||||
((2, 5), "1", 10.0),
|
((2, 5), "1", 10.0),
|
||||||
((1, 5), "1", 1.0),
|
((1, 5), "1", 1.0),
|
||||||
((6, 5), "-1", -100000.0),
|
|
||||||
((5, 5), "-1", -10000.0),
|
|
||||||
((4, 5), "-1", -1000.0),
|
|
||||||
((3, 5), "-1", -100.0),
|
|
||||||
((2, 5), "-1", -10.0),
|
|
||||||
((1, 5), "-1", -1.0),
|
|
||||||
((2, 5), "0", 0),
|
((2, 5), "0", 0),
|
||||||
]
|
]
|
||||||
for fmt, string, value in test_cases:
|
for fmt, string, value in test_cases:
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# install base requirements
|
|
||||||
-r requirements.txt
|
|
||||||
|
|
||||||
pytest==6.0.1
|
|
||||||
pytest-cov==2.10.1
|
|
|
@ -1,6 +0,0 @@
|
||||||
# install base requirements
|
|
||||||
-r requirements.txt
|
|
||||||
|
|
||||||
# documentation generation support
|
|
||||||
Sphinx==3.2.1
|
|
||||||
numpydoc==1.1.0
|
|
|
@ -1,2 +0,0 @@
|
||||||
# cairo rendering support
|
|
||||||
cairocffi==0.6
|
|
|
@ -1,2 +0,0 @@
|
||||||
[tool:pytest]
|
|
||||||
flake8-max-line-length = 120
|
|
31
setup.py
31
setup.py
|
@ -1,30 +1,13 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from os import environ
|
from pathlib import Path
|
||||||
from os.path import join, abspath, dirname
|
|
||||||
from codecs import open
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
from subprocess import check_output
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
def long_description():
|
|
||||||
with open('README.md', 'r') as fh:
|
|
||||||
return fh.read()
|
|
||||||
|
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
with open(join(abspath(dirname(__file__)), 'gerbonara/__init__.py')) as fh:
|
res = subprocess.run(['git', 'describe', '--tags', '--match', 'v*'], capture_output=True, check=True, text=True)
|
||||||
for line in fh:
|
version, _, _rest = res.stdout.strip()[1:].partition('-')
|
||||||
if line.startswith('__version__'):
|
return version
|
||||||
ver = line.split("'")[1]
|
|
||||||
if environ.get('CI_COMMIT_SHA', '') != '' and environ.get('CI_COMMIT_TAG', '') == '':
|
|
||||||
# attach commit hash to non tagged test uploads from CI
|
|
||||||
commits = check_output(['/usr/bin/env', 'git', 'rev-list', '--count', 'HEAD'], text=True)
|
|
||||||
return f'{ ver }.dev{ commits.strip() }'
|
|
||||||
return ver
|
|
||||||
|
|
||||||
raise RuntimeError('Unable to find version string.')
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='gerbonara',
|
name='gerbonara',
|
||||||
|
@ -32,7 +15,7 @@ setup(
|
||||||
author='jaseg, XenGi',
|
author='jaseg, XenGi',
|
||||||
author_email='gerbonara@jaseg.de',
|
author_email='gerbonara@jaseg.de',
|
||||||
description='Tools to handle Gerber and Excellon files in Python',
|
description='Tools to handle Gerber and Excellon files in Python',
|
||||||
long_description=long_description(),
|
long_description=Path('README.md').read_text(),
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
url='https://gitlab.com/gerbolyze/gerbonara',
|
url='https://gitlab.com/gerbolyze/gerbonara',
|
||||||
project_urls={
|
project_urls={
|
||||||
|
@ -50,8 +33,6 @@ setup(
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
#'Development Status :: 1 - Planning',
|
|
||||||
#'Development Status :: 3 - Alpha',
|
|
||||||
'Development Status :: 4 - Beta',
|
'Development Status :: 4 - Beta',
|
||||||
#'Development Status :: 5 - Production/Stable',
|
#'Development Status :: 5 - Production/Stable',
|
||||||
'Environment :: Console',
|
'Environment :: Console',
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
pytest
|
|
||||||
pytest-cov
|
|
||||||
pytest-xdist
|
|
||||||
pytest-flake8
|
|
||||||
twine
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
[tox]
|
||||||
|
envlist = py37, py310
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
deps = pytest
|
||||||
|
commands = pytest
|
Ładowanie…
Reference in New Issue