Skip to content

Commit b607089

Browse files
author
Thomas Offergeld
committed
Release 0.9.0
1 parent 5645b20 commit b607089

10 files changed

Lines changed: 88 additions & 115 deletions

File tree

.gitlab-ci.yml

Lines changed: 66 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
image: docker:git
2-
services:
3-
- docker:dind
4-
51
stages:
62
- build
73
- verify
@@ -10,6 +6,7 @@ stages:
106
- deploy:build
117
- deploy:check
128
- deploy:upload
9+
- deploy:doc
1310
- doc
1411

1512
variables:
@@ -24,6 +21,7 @@ variables:
2421
PYPI_PASSWORD: $PYPI_PASSWORD
2522

2623
build:
24+
# Build an image with all requirements installed to use in later stages
2725
tags:
2826
- linux
2927
stage: build
@@ -40,24 +38,15 @@ build:
4038
except:
4139
- Releases
4240

43-
pytest:
44-
extends: .test
45-
stage: test:unit
46-
script:
47-
- pytest --ignore=cimpyorm/Test/Integration --ignore=cimpyorm/Test/Deployment --junitxml=pytest.xml --cov
48-
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
49-
artifacts:
50-
when: always
51-
reports:
52-
junit: pytest.xml
53-
5441
pylint:
42+
# Run a static code style checker (pylint)
5543
extends: .test
5644
stage: verify
5745
script:
5846
- ./pylint.sh
5947

6048
bandit:
49+
# Run a static vulnerability checker (Bandit)
6150
extends: .test
6251
stage: verify
6352
allow_failure: true
@@ -69,57 +58,64 @@ bandit:
6958
expose_as: "Bandit"
7059
paths: [report.html]
7160

61+
pytest:
62+
# Run unit tests, skipping some more special test cases (Integration, Deployment)
63+
extends: .test
64+
image: python:${PY_VERSION}
65+
stage: test:unit
66+
script:
67+
- pip install -r requirements.txt
68+
- pip install -r dev-requirements.txt
69+
- pytest --ignore=cimpyorm/Test/Integration --ignore=cimpyorm/Test/Deployment --junitxml=pytest.xml --cov
70+
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
71+
needs: ["build"]
72+
artifacts:
73+
when: always
74+
reports:
75+
junit: pytest.xml
76+
parallel:
77+
matrix:
78+
- PY_VERSION: ["3.7", "3.8"]
79+
DUMMY: "0"
80+
7281
.integration:
82+
# Anchor for integration tests - retried once (sometimes services don't startup properly) and
83+
# only run on Dev branch
7384
tags:
7485
- docker
7586
image: $CONTAINER_TEST_IMAGE
7687
stage: test:integration
88+
needs: ["build"]
7789
retry: 1
7890
only:
7991
- Dev
8092

8193
integration:SQLite:
94+
# Test with SQLite Backend
8295
extends: .integration
8396
script:
8497
- pytest --maxfail=1 cimpyorm/Test/Integration/SQLite
8598

86-
pages:
87-
stage: doc
88-
only:
89-
- Releases
90-
tags:
91-
- docker
92-
image: $CONTAINER_TEST_IMAGE
93-
script:
94-
- cd docs
95-
- make html
96-
- cd ..
97-
- mkdir public
98-
- mv docs/_build/html/* public
99-
artifacts:
100-
paths:
101-
- public
102-
103-
.deploy_common:
99+
.deploy:
104100
only:
105101
- Releases
106102
tags:
107103
- docker
108104
image: python
109105

110106
build_dist:
111-
extends: .deploy_common
107+
extends: .deploy
112108
stage: deploy:build
113109
script:
114-
- pip install poetry
115-
- poetry build
110+
- pip install --upgrade setuptools wheel
111+
- python setup.py sdist bdist_wheel
116112
artifacts:
117-
when: on_success
118-
expire_in: 1 week
119113
paths:
120-
- dist
114+
- dist/
115+
121116

122117
check:
118+
# Show contents of build archive (for manual inspection)
123119
only:
124120
- Releases
125121
tags:
@@ -132,15 +128,43 @@ check:
132128
dependencies:
133129
- build_dist
134130

135-
upload:
136-
extends: .deploy_common
131+
release:pypi:
132+
# Release on pypi using twine and the variable-defined credentials
133+
extends: .deploy
137134
stage: deploy:upload
135+
needs: ["build_dist"]
138136
when: manual
139137
allow_failure: true
140138
script:
141-
- pip install -q twine toml requests pytest
139+
- pip install -q twine toml requests pytest pandas
142140
- twine upload --repository-url $PYPI_ENDPOINT --u $PYPI_USER --p $PYPI_PASSWORD dist/*
143141
- sleep 20
144142
- pytest cimpyorm/Test/Deployment
145143
dependencies:
146144
- build_dist
145+
146+
release:gitlab:
147+
extends: .deploy
148+
stage: deploy:upload
149+
needs: ["build_dist"]
150+
when: manual
151+
script:
152+
- pip install -q twine
153+
- TWINE_PASSWORD=${GITLAB_PACKAGE_KEY} TWINE_USERNAME=package-token python -m twine upload --verbose --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
154+
155+
doc:
156+
# Create PDF documentation
157+
tags:
158+
- docker
159+
image: $CI_REGISTRY/iaew/docker/python-texlive:3.7
160+
stage: deploy:doc
161+
script:
162+
- pip install sphinx sphinx-autodoc-typehints sphinx_rtd_theme
163+
- sphinx-build -b latex docs/ Documentation
164+
- cd Documentation && make
165+
artifacts:
166+
when: on_success
167+
expire_in: 1 week
168+
paths:
169+
- Documentation/cimpyorm.pdf
170+
needs: []

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7
1+
FROM python:3.8
22

33
COPY requirements.txt dev-requirements.txt /
44
RUN pip install -r requirements.txt &&\
@@ -8,4 +8,4 @@ COPY . /app
88

99
RUN pip install /app/
1010

11-
WORKDIR app
11+
WORKDIR app

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2018, Thomas Offergeld, Institute for High Voltage Technology, RWTH Aachen University
3+
Copyright (c) 2018-2019, Thomas Offergeld, Institute for High Voltage Technology, RWTH Aachen University
4+
Copyright (c) 2019-2021, Thomas Offergeld, High Voltage Equipment and Grids, Digitalization and Energy Economics, RWTH Aachen University
45
All rights reserved.
56

67
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ names_of_ConductingEquipment = [t.ConductingEquipment.name for t in all_terminal
4343

4444
---
4545
## Bug reports/feature requests
46-
Please use the Issue Tracker.
46+
Please use the Issue Tracker.

cimpyorm/Test/test_parser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
from cimpyorm import parse, backends
1717
from cimpyorm.Test import test_datasets
1818

19+
from cimpyorm import parse, backends
20+
from cimpyorm.Test import test_datasets
21+
1922
from defusedxml.lxml import fromstring
2023

2124
def test_single_object(cgmes_schema):

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ sphinx_rtd_theme
55
sphinx-autodoc-typehints
66
toml
77
pytest
8-
pytest-cov
8+
pytest-cov

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# -- Project information -----------------------------------------------------
2121

2222
project = 'CIMPyORM'
23-
copyright = '2018-2019 IfHT at RWTH Aachen University, 2019-2020 IAEW at RWTH Aachen University'
23+
copyright = '2018-2019 IfHT at RWTH Aachen University, 2019-2021 IAEW at RWTH Aachen University'
2424
author = 'Thomas Offergeld'
2525

2626
try:

pyproject.toml

Lines changed: 0 additions & 54 deletions
This file was deleted.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ pandas
77
tabulate
88
tqdm
99
click
10-
defusedxml < 0.7
10+
defusedxml < 0.7

setup.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
name='cimpyorm', # Required
2828
# https://www.python.org/dev/peps/pep-0440/
2929
# https://packaging.python.org/en/latest/single_source_version.html
30-
version='0.8.4', # Required
30+
version='0.9.0', # Required
3131
# https://packaging.python.org/specifications/core-metadata/#summary
3232
description="A database-backed ORM for CIM datasets.", # Required
3333
# https://packaging.python.org/specifications/core-metadata/#description-optional
3434
long_description=long_description, # Optional
3535
# https://packaging.python.org/specifications/core-metadata/#description-content-type-optional
3636
long_description_content_type='text/markdown', # Optional (see note above)
37-
url="http://www.ifht.rwth-aachen.de", # Optional
37+
url="http://www.iaew.rwth-aachen.de", # Optional
3838
author="Thomas Offergeld", # Optional
3939
author_email="t.offergeld@iaew.rwth-aachen.de", # Optional
4040
# For a list of valid classifiers, see https://pypi.org/classifiers/
@@ -44,8 +44,8 @@
4444
'License :: OSI Approved :: BSD License', 'Natural Language :: English',
4545
'Operating System :: OS Independent',
4646
'Programming Language :: Python :: 3',
47-
'Programming Language :: Python :: 3.6',
48-
'Programming Language :: Python :: 3.7'
47+
'Programming Language :: Python :: 3.7',
48+
'Programming Language :: Python :: 3.8'
4949
], # Optional
5050
packages=find_packages(exclude=[
5151
'cimpyorm/Test/Deployment/**',
@@ -54,13 +54,12 @@
5454
# https://packaging.python.org/en/latest/requirements.html
5555
install_requires=[
5656
'Click',
57-
'sqlalchemy (>=1.2,<2.0)',
58-
'networkx (>=2.2,<3.0)',
59-
'numpy (>=1.15,<2.0)',
60-
'lxml (>=4.2,<5.0)',
61-
'pytest (>=4.0,<5.0)',
62-
'pandas (>=0.24.1,<0.25.0)',
63-
'tabulate (>=0.8.3,<0.9.0)',
57+
'sqlalchemy',
58+
'networkx',
59+
'numpy',
60+
'lxml',
61+
'pandas',
62+
'tabulate',
6463
'tqdm',
6564
'defusedxml (<0.7.0)'
6665
], # Optional
@@ -71,7 +70,7 @@
7170
include_package_data=True,
7271
# https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use
7372
project_urls={ # Optional
74-
'homepage': 'http://www.ifht.rwth-aachen.de',
73+
'homepage': 'http://www.iaew.rwth-aachen.de',
7574
},
7675
entry_points='''
7776
[console_scripts]

0 commit comments

Comments
 (0)