Skip to content

Commit 6c8525e

Browse files
Upstream fixes
2 parents f1785c5 + 0d0cd57 commit 6c8525e

File tree

80 files changed

+17159
-2850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+17159
-2850
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
.ipynb_checkpoints
2222
.tags
2323
*.iml
24+
_scratch
2425

2526
## Python files
2627
# setup.py working directory
@@ -61,3 +62,4 @@ Thumbs.db
6162
doc/build
6263
doc/source/generated
6364
doc/_build
65+
doc/.doctrees

.travis.yml

Lines changed: 92 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,95 @@
1-
dist: xenial
1+
# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
24
language: python
3-
cache: pip
4-
python:
5-
- '2.7'
6-
- '3.4'
7-
- '3.5'
8-
- '3.7'
9-
env:
10-
- PYTHONPATH=$PYTHONPATH:./src
5+
6+
dist: xenial
7+
8+
9+
stages:
10+
- flake8
11+
- test
12+
- name: create release
13+
if: tag IS present
14+
- name: upload documentation
15+
if: tag IS present
16+
- name: deploy to pypi
17+
if: tag IS present
18+
19+
20+
matrix:
21+
22+
allow_failures:
23+
- env: TOXENV=py36-flake8
24+
25+
include:
26+
- python: 2.7
27+
env: TOXENV=py27-tests-codecov TOX_SKIP_MISSING_INTERPRETERS=False
28+
- python: 3.4
29+
dist: trusty
30+
env: TOXENV=py34-tests-codecov TOX_SKIP_MISSING_INTERPRETERS=False
31+
- python: 3.5
32+
env: TOXENV=py35-tests-codecov TOX_SKIP_MISSING_INTERPRETERS=False
33+
- python: 3.6
34+
env: TOXENV=py36-tests-codecov TOX_SKIP_MISSING_INTERPRETERS=False
35+
- python: 3.7
36+
env: TOXENV=py37-tests-codecov TOX_SKIP_MISSING_INTERPRETERS=False
37+
38+
39+
- stage: flake8
40+
python: 3.6
41+
env: TOXENV=py36-flake8
42+
43+
44+
- stage: create release
45+
python: 3.6
46+
install: pip install sphinx
47+
script:
48+
- sphinx-build -Ean -b html -j auto -D todo_include_todos=0 ./doc ./doc/_build/html
49+
- pushd ./doc/_build/html ; zip -r ../../../${TRAVIS_TAG}-doc.zip . ; popd
50+
deploy:
51+
provider: releases
52+
skip_cleanup: true
53+
api_key: "$GITHUB_TOKEN"
54+
file: "${TRAVIS_TAG}-doc.zip"
55+
draft: true
56+
on:
57+
tags: true
58+
59+
60+
- stage: upload documentation
61+
python: 3.6
62+
install: pip install sphinx
63+
script:
64+
- sphinx-build -Ean -b html -j auto -D todo_include_todos=0 ./doc ./doc/_build/html
65+
- touch ./doc/_build/html/.nojekyll
66+
deploy:
67+
provider: pages
68+
skip_cleanup: true
69+
github_token: "$GITHUB_TOKEN"
70+
keep_history: false
71+
local_dir: "./doc/_build/html"
72+
on:
73+
tags: true
74+
75+
76+
- stage: deploy to pypi
77+
script:
78+
-
79+
deploy:
80+
provider: pypi
81+
user:
82+
secure: BkSk3YOVq/wb10zg6ceI7NdymLWhuexH8WH2KHHVIBaZDeoo1Hfzm6bSwxIPlngN5737ubBgVXnCM7oSElPh9oQYhX6PyNPR2X9DshQCoM1iShIhdo3Wb9XYT0V/MZ6/yf9pqbirx1mQ7rM+xTs9lrw7OCgi1/fJXPmXc7Qv8DGfhT0y9SbsktIJoAPg4qjWuGbo/2Jm5l8UNmTp6N5brJO+C1cRp65fZ1LcJ6PeWK+0iIi+oLyMz74TYrVAh+eqIlbnB6ss7WBHw7Bh3Cr7QjyaH5dDBGkouPPUbkSy9tNDcLUERSKPPPAOtY53tADI6ap+2hLFMKFz1wuOBwrabbsxkbdTPNbd9sS6bMrdHajRwuE7WyFkKe4yd9JzmafrBzUsR+hjyjCDIBT9lwn9EIeWaKtbm2zOmh7EbQBhK2q71hc+8ZiDx42uWIpEZnCSkWJYyGHdHiy1kgPsqWnUOMxReIRSfqdrdkVBfA6F68nh5k9w06chSj81Tb/mAnf3xGI8r3EwqMlXfyo+bBCYK3NibaBYMy4xhUiH566cQ+1Rt6JdAaVZIgK6Euu7zas0szZKddXUelaLlc2VHUyoJR8gazVdK6V8hDJykZb85KYp0lWhd78v4ANsDzSjjxoO8YT43iwiFgHarjXN1Vnd9fixWinT3r3BCdUryetOQ1g=
83+
password:
84+
secure: UOnKL5rBTgv8ubh/0l+4BKEO1C89h/PF3y+Y6cq40881yQLkLItTDxYkWCf36m6L/IyOnACwn5kJziQuTUSgyzfN58TRBvjVagjdkDQtwObLZVoU5PX+aMLRF+D7djdIekiOvhvQ476UDUR8jL3FwcQU4QJ72KQJqNn/UohdQquDP91qlcr+XLN/rvLeJAdQ8brOjpansX5qbHuJey+9oGgl9cwAVapvGVzvxk46oDb8hSrWJXZZU5PeEkoOdtGnOUdmWTtjuPjjYA6Fk/jyk+3fSgolHqa4vjFLu2PfDK+hDSZY1JIAxqUGKRzj+O4J2cm5ChMOwB4FwkA+7ZUBptHKnAD+qD4Z2iDRvkVTGgOUsmwS25DAcoEM6t9j5bjozW1vgCiIjf51v6GplQC0rY/QpxVkDnNlLC9Ov+paj+3KgG+BI2S+gjb9XD9tgnsHXpgc0i3dZSmjaO4eA9jetm9bG32irDdQGSifF27vv0m3X1GlgeIYtK2kZnUmxFBYadiGCGBk3+V78VKCLiTsB/G5b/9L70AaQmodPjYiOqmi2K5k6rMJ0lpP52ho3njN2oIvH7Ot4vNdc75qXlsHFX1VQfQlenxuzWszmlQQQAfQ+uj26rhftaKiYfPETPTztRHoRIeyYxqCnpNU5oGw3EcWQklxyNDVH0FqQ7H5iZw=
85+
distributions: sdist bdist_wheel
86+
on:
87+
tags: true
88+
89+
1190
install:
12-
- pip install -r test_requirements.txt
91+
- pip install tox
92+
93+
1394
script:
14-
- pytest
15-
jobs:
16-
include:
17-
- stage: upload codecov results
18-
python: 3.6
19-
install:
20-
- pip install pytest pytest-cov codecov
21-
- pip install -r test_requirements.txt
22-
script:
23-
- pytest --cov=./
24-
- codecov
25-
- stage: create release
26-
if: tag is present
27-
python: 3.6
28-
install: pip install sphinx
29-
script:
30-
- sphinx-build -Ean -b html -j auto -D todo_include_todos=0 ./doc ./doc/_build/html
31-
- pushd ./doc/_build/html ; zip -r ../../../${TRAVIS_TAG}-doc.zip . ; popd
32-
deploy:
33-
provider: releases
34-
skip_cleanup: true
35-
api_key: "$GITHUB_TOKEN"
36-
file: "${TRAVIS_TAG}-doc.zip"
37-
draft: true
38-
on:
39-
tags: true
40-
- stage: upload documentation
41-
if: tag is present
42-
python: 3.6
43-
install: pip install sphinx
44-
script:
45-
- sphinx-build -Ean -b html -j auto -D todo_include_todos=0 ./doc ./doc/_build/html
46-
- touch ./doc/_build/html/.nojekyll
47-
deploy:
48-
provider: pages
49-
skip_cleanup: true
50-
github_token: "$GITHUB_TOKEN"
51-
keep_history: false
52-
local_dir: "./doc/_build/html"
53-
on:
54-
tags: true
55-
- stage: deploy to pypi (test)
56-
if: tag is present
57-
script:
58-
-
59-
deploy:
60-
provider: pypi
61-
user:
62-
secure: BkSk3YOVq/wb10zg6ceI7NdymLWhuexH8WH2KHHVIBaZDeoo1Hfzm6bSwxIPlngN5737ubBgVXnCM7oSElPh9oQYhX6PyNPR2X9DshQCoM1iShIhdo3Wb9XYT0V/MZ6/yf9pqbirx1mQ7rM+xTs9lrw7OCgi1/fJXPmXc7Qv8DGfhT0y9SbsktIJoAPg4qjWuGbo/2Jm5l8UNmTp6N5brJO+C1cRp65fZ1LcJ6PeWK+0iIi+oLyMz74TYrVAh+eqIlbnB6ss7WBHw7Bh3Cr7QjyaH5dDBGkouPPUbkSy9tNDcLUERSKPPPAOtY53tADI6ap+2hLFMKFz1wuOBwrabbsxkbdTPNbd9sS6bMrdHajRwuE7WyFkKe4yd9JzmafrBzUsR+hjyjCDIBT9lwn9EIeWaKtbm2zOmh7EbQBhK2q71hc+8ZiDx42uWIpEZnCSkWJYyGHdHiy1kgPsqWnUOMxReIRSfqdrdkVBfA6F68nh5k9w06chSj81Tb/mAnf3xGI8r3EwqMlXfyo+bBCYK3NibaBYMy4xhUiH566cQ+1Rt6JdAaVZIgK6Euu7zas0szZKddXUelaLlc2VHUyoJR8gazVdK6V8hDJykZb85KYp0lWhd78v4ANsDzSjjxoO8YT43iwiFgHarjXN1Vnd9fixWinT3r3BCdUryetOQ1g=
63-
password:
64-
secure: UOnKL5rBTgv8ubh/0l+4BKEO1C89h/PF3y+Y6cq40881yQLkLItTDxYkWCf36m6L/IyOnACwn5kJziQuTUSgyzfN58TRBvjVagjdkDQtwObLZVoU5PX+aMLRF+D7djdIekiOvhvQ476UDUR8jL3FwcQU4QJ72KQJqNn/UohdQquDP91qlcr+XLN/rvLeJAdQ8brOjpansX5qbHuJey+9oGgl9cwAVapvGVzvxk46oDb8hSrWJXZZU5PeEkoOdtGnOUdmWTtjuPjjYA6Fk/jyk+3fSgolHqa4vjFLu2PfDK+hDSZY1JIAxqUGKRzj+O4J2cm5ChMOwB4FwkA+7ZUBptHKnAD+qD4Z2iDRvkVTGgOUsmwS25DAcoEM6t9j5bjozW1vgCiIjf51v6GplQC0rY/QpxVkDnNlLC9Ov+paj+3KgG+BI2S+gjb9XD9tgnsHXpgc0i3dZSmjaO4eA9jetm9bG32irDdQGSifF27vv0m3X1GlgeIYtK2kZnUmxFBYadiGCGBk3+V78VKCLiTsB/G5b/9L70AaQmodPjYiOqmi2K5k6rMJ0lpP52ho3njN2oIvH7Ot4vNdc75qXlsHFX1VQfQlenxuzWszmlQQQAfQ+uj26rhftaKiYfPETPTztRHoRIeyYxqCnpNU5oGw3EcWQklxyNDVH0FqQ7H5iZw=
65-
distributions: sdist bdist_wheel
66-
on:
67-
tags: true
95+
- tox

CHANGELOG.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,94 @@
11

22
Unreleased
33
----------
4+
-
5+
6+
v1.2.4 (2019-9-20)
7+
------------------
8+
**Bugfixes**
9+
- `model_repository.get_model_contents` no longer raises an HTTP 406 error.
10+
11+
v1.2.3 (2019-8-23)
12+
------------------
13+
**Changes**
14+
- `put` request will take an `item` parameter that's used to automatically populate headers for updates.
15+
16+
**Bugfixes**
17+
- Convert NaN values to null (None) when calling `microanalytic_score.execute_module_step`.
18+
19+
20+
v1.2.2 (2019-8-21)
21+
------------------
22+
**Bugfixes**
23+
- `register_model` task should now correctly identify columns when registering a Sci-kit pipeline.
24+
25+
26+
v1.2.1 (2019-8-20)
27+
------------------
28+
**Improvements**
29+
- Added the ability for `register_model` to correctly handle CAS tables containing data step
30+
score code.
31+
32+
33+
v1.2.0 (2019-8-16)
34+
------------------
35+
**Improvements**
36+
- Added `create_model_version` and `list_model_versions` to `model_repository`
37+
- Added an explicit `ValueError` when attempting to register an ASTORE that can't be downloaded.
38+
- Added `start` and `limit` pagination parameters to all default `list_*` service methods.
39+
- Added `create_destination`, `create_cas_destination` and `create_mas_destination` methods for `model_publish` service.
40+
41+
**Changes**
42+
- `Session.add_stderr_logger` default logging level changed to `DEBUG`.
43+
44+
**Bugfixes**
45+
- Fixed an issue where `model_repository` did not find models, projects, or repositories by name once pagination limits were reached.
46+
47+
48+
v1.1.4 (2019-8-16)
49+
-----------------
50+
**Bugfixes**
51+
- The `register_model` task now generates dmcas_epscorecode.sas files for ASTORE models.
52+
53+
54+
v1.1.3 (2019-8-14)
55+
-----------------
56+
**Bugfixes**
57+
- Fixed problem causing `register_model` task to include output variables in the input variables list.
58+
59+
60+
v1.1.2 (2019-8-12)
61+
-----------------
62+
**Improvements**
63+
- CAS model table automatically reloaded on `publish_model` task.
64+
65+
**Bugfixes**
66+
- Fixed DS2 score code for CAS that was generated when registering a Python model.
67+
- `PyMAS.score_code(dest='ESP')` corrected to `dest='EP'`
68+
- Fixed an issue where long user-defined properties prevented model registration.
69+
70+
71+
v1.1.1 (2019-8-6)
72+
-----------------
73+
**Bugfixes**
74+
- Fixed an issue where usernames were not parsed correctly from .authinfo files, resulting in failed logins.
75+
76+
77+
v1.1.0 (2019-8-5)
78+
-----------------
79+
**Improvements**
80+
- Added `update_module` and `delete_module` methods to MAS service.
81+
82+
**Changed**
83+
- Added `replace` parameter to `sasctl.tasks.publish_model`
84+
- `Session` hostname's can now be specified in HTTP format: 'http://example.com'.
85+
86+
**Bugfixes**
87+
- Renamed `microanalytic_store` service to `microanalytic_score`
88+
89+
90+
v1.0.1 (2019-07-31)
91+
-------------------
492
**Changed**
593
- Exceptions moved from `sasctl.core` to `sasctl.exceptions`
694
- `SWATCASActionError` raised if ASTORE cannot be saved during model registration.

CONTRIBUTING.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ integration testing without requiring a running SAS Viya environment, the
3131
[Betamax](https://pypi.org/project/betamax/) package is used to record and
3232
replay network interactions.
3333

34-
In addition, [Tox](https://tox.readthedocs.io) is used to test
35-
compatibility with different Python version.
34+
In addition, [Tox](https://tox.readthedocs.io) is used to automate common development tasks
35+
such as testing, linting, and building documentation.
3636

3737
All packages required for development and testing are listed in
38-
[test_requirements.txt](test_requirements.txt) and can be easily installed with
39-
```
40-
pip install -r test_requirements.txt
41-
```
42-
38+
[tox.ini](tox.ini), but it should be unecessary to install these manually. Running `tox`
39+
from the project root directory will automatically build virtual environments for all
40+
Python interpreters found on the system and then install the required packages in those environments.
4341

4442
Before a pull request will be accepted:
4543
- contributions must pass existing regression tests located in tests/

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.md
2+
include LICENSE
3+
include CHANGELOG.md

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</a>
1111
1212
<a href="https://www.python.org/">
13-
<img src="https://img.shields.io/badge/Python-2.7%20%7C%203%2B-blue.svg" alt="Python Version">
13+
<img src="https://img.shields.io/badge/Python-2.7%20%7C%203.4%2B-blue.svg" alt="Python Version">
1414
</a>
1515

1616
<img src="https://travis-ci.com/sassoftware/python-sasctl.svg?branch=master">
@@ -81,15 +81,16 @@ which can handle all necessary communication with the SAS Viya server:
8181
8282
>>> with Session('example.com', authinfo=<authinfo file>):
8383
... model = lm.LogisticRegression()
84-
... register_model('Sklearn Model', model, 'My Project')
84+
... register_model(model, 'Sklearn Model', 'My Project')
8585
```
8686

8787

8888
A slightly more low-level way to interact with the environment is to use
8989
the service methods directly:
9090
```
9191
>>> from pprint import pprint
92-
>>> from sasctl import Session, folders
92+
>>> from sasctl import Session
93+
>>> from sasctl.services import folders
9394
9495
>>> with Session(host, username, password):
9596
... folders = folders.list_folders()
@@ -150,7 +151,8 @@ complete examples see the [examples](examples) folder.
150151

151152
Show models currently in Model Manager:
152153
```
153-
>>> from sasctl import Session, model_repository
154+
>>> from sasctl import Session
155+
>>> from sasctl.services import model_repository
154156
155157
>>> with Session(host, username, password):
156158
... models = model_repository.list_models()
@@ -163,7 +165,7 @@ Register a pure Python model in Model Manager:
163165
164166
>>> with Session(host, authinfo=<authinfo file>):
165167
... model = lm.LogisticRegression()
166-
... register_model('Sklearn Model', model, 'My Project')
168+
... register_model(model, 'Sklearn Model', 'My Project')
167169
```
168170

169171
Register a CAS model in Model Manager:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
sasctl.services.microanalytic\_store
1+
sasctl.services.microanalytic\_score
22
====================================
33

4-
.. automodule:: sasctl._services.microanalytic_store
4+
.. automodule:: sasctl._services.microanalytic_score
55
:members:
66
:undoc-members:
77
:show-inheritance:

doc/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
'betamax': ('https://betamax.readthedocs.io/en/latest/', None),
5555
'requests': (
5656
'https://2.python-requests.org/en/master/', None),
57-
'tox': ('https://tox.readthedocs.io/en/latest/', None)}
57+
'tox': ('https://tox.readthedocs.io/en/latest/', None),
58+
'flake8': ('http://flake8.pycqa.org/en/latest/', None)}
5859

5960
todo_include_todos = True
6061

0 commit comments

Comments
 (0)