-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '3.x.x' of github.com:c0fec0de/anytree
- Loading branch information
Showing
16 changed files
with
166 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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,9 +1,10 @@ | ||
name: Python | ||
name: test | ||
|
||
on: [push] | ||
on: [push, pull_request, release] | ||
|
||
jobs: | ||
test: | ||
build: | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
@@ -19,8 +20,6 @@ jobs: | |
python -m pip install --upgrade pip | ||
sudo apt-get install -y graphviz | ||
pip install tox "poetry>=1.4" coveralls | ||
git --version | ||
git submodule --help | ||
- name: TOX | ||
run: tox | ||
- name: Upload coverage data to coveralls.io | ||
|
@@ -32,7 +31,7 @@ jobs: | |
|
||
coveralls: | ||
name: Indicate completion to coveralls.io | ||
needs: test | ||
needs: build | ||
runs-on: ubuntu-latest | ||
container: python:3-slim | ||
steps: | ||
|
@@ -42,3 +41,14 @@ jobs: | |
coveralls --service=github --finish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
publish: | ||
if: github.event_name == 'push' && github.ref_type == 'tag' | ||
needs: coveralls | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build and publish to pypi | ||
uses: JRubics/[email protected] | ||
with: | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} |
This file contains 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,18 @@ | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the version of Python and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.9" | ||
|
||
commands: | ||
- pip install --upgrade --no-cache-dir pip | ||
- pip install --no-cache-dir "poetry>=1.4" "crashtest==0.4.1" | ||
- poetry install --with=doc --without=test | ||
- poetry run make html -C docs | ||
- cp -r docs/build _readthedocs |
This file contains 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,63 @@ | ||
# Contribute | ||
|
||
## Branches | ||
|
||
* `2.x.x` main line for 2.x.x | ||
* `3.x.x` actual main line | ||
* documentation links refer to `3.x.x` | ||
* `main` | ||
* documentation links refer to `latest` | ||
|
||
## Testing | ||
|
||
### Create Environment | ||
|
||
Run these commands just the first time: | ||
|
||
```bash | ||
# Ensure python3 is installed | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
pip install tox "poetry>=1.4" "crashtest==0.4.1" | ||
``` | ||
|
||
### Enter Environment | ||
|
||
Run this command once you open a new shell: | ||
|
||
```bash | ||
source .venv/bin/activate | ||
``` | ||
|
||
### Test Your Changes | ||
|
||
```bash | ||
# test | ||
tox | ||
``` | ||
|
||
### Release | ||
|
||
```bash | ||
git pull | ||
|
||
prev_version=$(poetry version -s) | ||
|
||
# Version Bump | ||
poetry version minor | ||
# OR | ||
poetry version patch | ||
|
||
# Commit, Tag and Push | ||
version=$(poetry version -s) | ||
|
||
sed "s/$prev_version/$version/g" -i README.rst | ||
sed "s/$prev_version/$version/g" -i docs/index.rst | ||
|
||
git commit -m"version bump to ${version}" pyproject.toml README.rst docs/index.rst | ||
git tag "${version}" -m "Release ${version}" | ||
git push | ||
git push --tags | ||
|
||
# Publishing is handled by CI | ||
``` |
This file contains 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,6 @@ | ||
"""Central Configuration.""" | ||
|
||
import os | ||
|
||
# Global Option which enables all internal assertions. | ||
ASSERTIONS = bool(int(os.environ.get("ANYTREE_ASSERTIONS", 0))) |
This file contains 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 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 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -8,3 +8,4 @@ Tricks | |
tricks/yaml | ||
tricks/multidim | ||
tricks/weightededges | ||
tricks/consistencychecks |
This file contains 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,13 @@ | ||
Consistency Checks vs. Speed | ||
============================ | ||
|
||
Anytree can run some *costly* internal consistency checks. | ||
With version 2.9.2 these got disabled by default. | ||
In case of any concerns about the internal data consistency or just for safety, either | ||
|
||
* set the environment variable ``ANYTREE_ASSERTIONS=1``, or | ||
* add the following lines to your code: | ||
|
||
>>> import anytree | ||
>>> anytree.config.ASSERTIONS = True | ||
|
This file contains 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 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