Skip to content

Commit

Permalink
Merge pull request #9 from compas-rrc/release-prep
Browse files Browse the repository at this point in the history
Release prep
  • Loading branch information
gonzalocasas authored Mar 26, 2021
2 parents f8fd727 + ed38cdc commit dc0ad63
Show file tree
Hide file tree
Showing 21 changed files with 477 additions and 116 deletions.
5 changes: 5 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ tag = True
search = version = release = '{current_version}'
replace = version = release = '{new_version}'

[bumpversion:file:docs/doc_versions.txt]
search = {current_version}
replace = {new_version}
{current_version}

[bumpversion:file:CHANGELOG.rst]
search = Unreleased
replace = {new_version}
Expand Down
76 changes: 76 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Thank you for your pull request! -->
<!-- Please start by describing your change in a few sentences. -->
<!-- You can erase any parts of this template not applicable to your Pull Request. -->

### What type of change is this?

- [ ] Bug fix in a **backwards-compatible** manner.
- [ ] New feature in a **backwards-compatible** manner.
- [ ] Breaking change: bug fix or new feature that involve incompatible API changes.
- [ ] Other (e.g. doc update, configuration, etc)

### Checklist

_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._

- [ ] I added a line to the `CHANGELOG.rst` file in the `Unreleased` section under the most fitting heading (e.g. `Added`, `Changed`, `Removed`).
- [ ] I ran all tests on my computer and it's all green (i.e. `invoke test`).
- [ ] I ran lint on my computer and there are no errors (i.e. `invoke lint`).
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added necessary documentation (if appropriate)
66 changes: 66 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-cpython:
runs-on: ${{ matrix.os }}
strategy:
matrix:
name: [
"windows-py38",
"macos-py37",
"ubuntu-py36",
]
include:
- name: "windows-py38"
os: windows-latest
python-version: 3.8
- name: "macos-py37"
os: macos-latest
python-version: 3.7
- name: "ubuntu-py36"
os: ubuntu-latest
python-version: 3.6
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install cython --install-option="--no-cython-compile"
- name: Install
run: |
python -m pip install --no-cache-dir -r requirements-dev.txt
- name: Run linter
run: |
invoke lint
- name: Run tests
run: |
pytest
build-ironpython:
name: windows-ironpython
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
choco install ironpython --version=2.7.8.1
ipy -X:Frames -m ensurepip
ipy -X:Frames -m pip install --no-deps compas compas_fab roslibpy
ipy -X:Frames -m pip install ironpython-pytest
- name: Run tests
env:
IRONPYTHONPATH: ./src
run: |
ipy tests/ipy_test_runner.py
74 changes: 74 additions & 0 deletions .github/workflows/deploy-n-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: deploy-and-publish

on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main

jobs:
build:
name: build and deploy docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: 🔗 Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install cython --install-option="--no-cython-compile"
- name: 💎 Install
run: |
python -m pip install --no-cache-dir -r requirements-dev.txt
- name: 📃 Generate docs
if: success()
run: |
invoke docs --check-links
# Get branch/tag/latest name from git
GITHUB_REF_REGEX="tags/v([0-9a-zA-Z\.\-]+)|(pull/[0-9]+)|heads/(.+)"
if [[ $GITHUB_REF =~ $GITHUB_REF_REGEX ]]; then
if [[ $BASH_REMATCH = pull* ]]; then
BRANCH_OR_TAG=pull_${BASH_REMATCH##*/}
elif [[ $BASH_REMATCH = tags/v* ]]; then
# 2nd element is tag, #v replaces prefix v
BRANCH_OR_TAG=${BASH_REMATCH[1]#v}
else
BRANCH_OR_TAG=${BASH_REMATCH##*/}
fi;
if [[ $BRANCH_OR_TAG = main ]]; then
BRANCH_OR_TAG=latest
fi;
fi;
echo "Docs will be deployed to https://compas-rrc.github.io/compas_rrc/$BRANCH_OR_TAG"
mkdir -p deploy/$BRANCH_OR_TAG && mv -T dist/docs deploy/$BRANCH_OR_TAG/
- name: 🚢 Deploy docs
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: deploy
keep_history: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 💃 Build release
if: success() && startsWith(github.ref, 'refs/tags')
run: |
python setup.py clean --all sdist bdist_wheel
- name: 📦 Publish release to PyPI
if: success() && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}

19 changes: 19 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: verify-pr-checklist
on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:
- main

jobs:
build:
name: Check Actions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Changelog check
uses: Zomzog/[email protected]
with:
fileName: CHANGELOG.rst
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ Changelog
Unreleased
----------

**Added**

* Prepared github actions for continuous integration
* Added compas plugin for automatic Rhino install

**Changed**

**Fixed**

**Deprecated**

**Removed**

1.0.0
-------
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ command line to ease recurring operations:
* ``invoke clean``: Clean all generated artifacts.
* ``invoke check``: Run various code and documentation style checks.
* ``invoke docs``: Generate documentation.
* ``invoke test``: Run all tests and checks in one swift command.
* ``invoke test``: Run all tests.
* ``invoke``: Show available tasks.


Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You can find additional examples to get your started easily on `the compas_rrc_s
Contributing
------------

Check the `Contributor's Guide <CONTRIBUTING.rst>`_.
Check the `Contributor's Guide <https://github.com/compas-rrc/compas_rrc/blob/main/CONTRIBUTING.rst>`_.

Credits
-------------
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
html_copy_source = False
html_show_sourcelink = False
html_add_permalinks = ''
html_permalinks = False
html_experimental_html5_writer = True
html_compact_lists = True

Expand Down
1 change: 1 addition & 0 deletions docs/doc_versions.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
latest
1.0.0
2 changes: 1 addition & 1 deletion src/compas_rrc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
StopWatch
)


__all_plugins__ = ['compas_rrc.__install']
__all__ = [
'__url__',
'__version__',
Expand Down
6 changes: 6 additions & 0 deletions src/compas_rrc/__install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import compas.plugins


@compas.plugins.plugin(category='install')
def installable_rhino_packages():
return ['compas_rrc']
4 changes: 2 additions & 2 deletions src/compas_rrc/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
__description__ = 'COMPAS RRC: Library for ABB Robots'
__url__ = 'https://github.com/compas-rrc/compas_rrc'
__version__ = '1.0.0'
__author__ = 'ETH Zürich'
__author__ = 'ETH Zurich'
__author_email__ = '[email protected]'
__license__ = 'MIT license'
__copyright__ = 'Copyright 2019 ETH Zürich'
__copyright__ = 'Copyright 2019 ETH Zurich'

__all__ = ['__author__', '__author_email__', '__copyright__', '__description__', '__license__', '__title__', '__url__', '__version__']
2 changes: 1 addition & 1 deletion src/compas_rrc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class AbbClient(object):
"""

def __init__(self, ros, namespace='/rob1'):
"""Initilize a new robot client instance.
"""Initialize a new robot client instance.
Parameters
----------
Expand Down
11 changes: 9 additions & 2 deletions src/compas_rrc/common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import itertools
import threading

__all__ = ['CLIENT_PROTOCOL_VERSION',
Expand Down Expand Up @@ -99,7 +100,10 @@ def __init__(self, *values):
values : :obj:`list`
List of floats indicating the external axis positions.
"""
self.values = list(values)
try:
self.values = list(itertools.chain.from_iterable(values))
except TypeError:
self.values = list(values)

# Properties
@property
Expand Down Expand Up @@ -180,7 +184,10 @@ class RobotJoints(object):
"""Represents a configuration for robot joints"""

def __init__(self, *values):
self.values = list(values)
try:
self.values = list(itertools.chain.from_iterable(values))
except TypeError:
self.values = list(values)

# Properties
@property
Expand Down
Loading

0 comments on commit dc0ad63

Please sign in to comment.