-
Notifications
You must be signed in to change notification settings - Fork 33
[v2.0.1] CircleCI, 500 Error code, Readme updates #27
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a1bf8b7
readme updates
fatihkurtoglu 4ab3c1f
readme updates
fatihkurtoglu b9cd439
version bumped
fatihkurtoglu 38b275d
docstring tools for developer guide
fatihkurtoglu fff92f5
circleci configurations
fatihkurtoglu bc385ad
pytest test key validation
fatihkurtoglu 590ebda
added 500 error code to retry
fatihkurtoglu 6e5d52c
updated publish script
fatihkurtoglu 9bfe8e0
version bumped
fatihkurtoglu 2ed2d25
circleci config updates
fatihkurtoglu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# CircleCI jobs are only enabled to on Pull Requests and commits to master branch. | ||
# "Only build pull requests" enabled in Project's Advanced Settings. | ||
version: 2.1 | ||
jobs: | ||
build_test: | ||
docker: | ||
- image: cimg/python:3.6 | ||
resource_class: small | ||
steps: | ||
- checkout # checkout source code to working directory | ||
- run: | ||
name: Install Environment Dependencies | ||
command: | # install env dependencies | ||
set -e | ||
pip install --upgrade pip | ||
pip install -r docs/dev_requirements.txt | ||
- run: | ||
name: Black Formatting Check # Only validation, without re-formatting | ||
command: | | ||
black --check -t py36 . | ||
- run: | ||
name: isort Import Ordering Check # Only validation, without re-formatting | ||
command: | | ||
isort --check-only --profile black . | ||
- run: | ||
name: Flake8 Lint Check # Uses setup.cfg for configuration | ||
command: | | ||
flake8 . --count --statistics | ||
- run: | ||
name: Pylint Lint Check # Uses .pylintrc for configuration | ||
command: | | ||
pylint scaleapi | ||
- run: | ||
name: Build Package # create whl and install package | ||
command: | | ||
set -e | ||
python setup.py sdist bdist_wheel | ||
pip install --no-cache-dir dist/*.whl | ||
- run: | ||
name: Pytest Test Cases | ||
command: | # Run test suite, uses SCALE_TEST_API_KEY env variable | ||
pytest -v | ||
- run: | ||
name: Twine PyPI Check | ||
command: | # Validate distribution and setup.py configuration | ||
twine check --strict dist/* | ||
pypi_publish: | ||
docker: | ||
- image: cimg/python:3.6 | ||
steps: | ||
- checkout # checkout source code to working directory | ||
- run: | ||
name: Validate Tag Version # Check if the tag name matches the package version | ||
command: | | ||
PKG_VERSION=$(sed -n 's/^__version__ = //p' scaleapi/_version.py | sed -e 's/^"//' -e 's/"$//') | ||
|
||
if [[ "$CIRCLE_TAG" != "v${PKG_VERSION}" ]]; then | ||
echo "ERROR: Tag name ($CIRCLE_TAG) must match package version (v${PKG_VERSION})." | ||
exit 1; | ||
fi | ||
- run: | ||
name: Validate SDK Version Increment # Check if the version is already on PyPI | ||
command: | | ||
PKG_VERSION=$(sed -n 's/^__version__ = //p' scaleapi/_version.py | sed -e 's/^"//' -e 's/"$//') | ||
|
||
if pip install "scaleapi>=${PKG_VERSION}" > /dev/null 2>&1; | ||
then | ||
echo "ERROR: You need to increment to a new version before publishing!" | ||
echo "Version (${PKG_VERSION}) already exists on PyPI." | ||
exit 1; | ||
fi | ||
- run: | ||
name: Install Environment Dependencies | ||
command: | # install env dependencies | ||
set -e | ||
pip install --upgrade pip | ||
pip install twine | ||
- run: | ||
name: Build and Validate | ||
command: | # create whl, validate with twine | ||
set -e | ||
python setup.py sdist bdist_wheel | ||
twine check --strict dist/* | ||
- run: | ||
name: Publish to PyPI | ||
command: | | ||
if test -z "${TWINE_USERNAME}" || test -z "${TWINE_PASSWORD}" ; then | ||
echo "ERROR: Please assign TWINE_USERNAME and TWINE_PASSWORD as environment variables" | ||
exit 1 | ||
fi | ||
twine upload dist/* | ||
workflows: | ||
build_test_publish: | ||
jobs: | ||
- build_test | ||
- pypi_publish: | ||
requires: | ||
- build_test | ||
filters: | ||
tags: | ||
only: /^v\d+\.\d+\.\d+$/ # Runs only for tags with the format [v1.2.3] | ||
branches: | ||
ignore: /.*/ # Runs for none of the branches |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ pre-commit==2.11.1 | |
isort>=5.7.0 | ||
pytest>=6.2.2 | ||
pylint>=2.7.2 | ||
twine>=3.4.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
__version__ = "2.0.0" | ||
__version__ = "2.0.1" | ||
__package_name__ = "scaleapi" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python 3.6 is getting close to EOL, do we want to standardize on python 3.8 or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We updated our SDK's min requirement from py2.7 to py3.6 and wanted to be still compatible while py3.6 is still maintained. CircleCI is matching that min requirement to be consistent.