Compare commits

..

16 Commits

Author SHA1 Message Date
izzy lyseggen d1b3d5e25e Merge pull request #117 from specklesystems/izzy/tiny-fix
fix(objects): init polyline value w empty list
2021-08-12 11:51:34 +01:00
izzy lyseggen 79cca557f5 fix(objects): init polyline value w empty list
soz!
2021-08-12 11:49:41 +01:00
izzy lyseggen 1e6e66a90a Merge pull request #116 from specklesystems/izzy/commit-spec
feat(client): add `branchName` to commit model
2021-08-11 09:24:49 +01:00
izzy lyseggen 09d84cf64a feat(client): add branchName to commit model 2021-08-11 09:21:04 +01:00
izzy lyseggen 3ccb0ae2a8 ci: try diff env tag variable 2021-08-10 15:49:08 +01:00
izzy lyseggen 6028a38355 Merge pull request #115 from specklesystems/ci/tags-and-versions
ci: fix workflows and patch version with git tag
2021-08-10 15:42:42 +01:00
izzy lyseggen 07418cfc9c ci: rename test job 2021-08-10 15:41:03 +01:00
izzy lyseggen 1ada797d81 ci: rename test job 2021-08-10 15:40:32 +01:00
izzy lyseggen 73703f6237 ci: patch version with git tag 2021-08-10 15:38:02 +01:00
izzy lyseggen 7644af22df fix(ci): add tag filter to build job 2021-08-10 15:37:19 +01:00
izzy lyseggen 564e1d4432 Merge pull request #114 from specklesystems/izzy/stream-wrapper-update
feat(wrapper): add get acct helper
2021-08-10 12:34:08 +01:00
izzy lyseggen fc4511ad02 chore: bump version 2021-08-10 12:03:06 +01:00
izzy lyseggen ad710b72da feat(wrapper): add acct helper 2021-08-10 12:02:42 +01:00
izzy lyseggen 041d9f56ce ci: another workflow fix 🙃 2021-08-06 17:13:16 +01:00
izzy lyseggen e1c0b705ad ci: build in deploy fix 2021-08-06 17:10:55 +01:00
izzy lyseggen 7b011b1122 ci: require build in deploy step 2021-08-06 17:06:42 +01:00
7 changed files with 60 additions and 13 deletions
+9 -6
View File
@@ -4,7 +4,7 @@ orbs:
python: circleci/python@1.3.2
jobs:
build:
test:
docker:
- image: "cimg/python:<<parameters.tag>>"
- image: "circleci/node:12"
@@ -45,20 +45,23 @@ jobs:
- image: "circleci/python:3.8"
steps:
- checkout
- run: python patch_version.py $CIRCLE_TAG
- run: poetry build
- run: poetry publish -u specklesystems -p $PYPI_PASSWORD
workflows:
main:
jobs:
- build:
jobs:
- test:
matrix:
parameters:
tag: ["3.6", "3.7", "3.8", "3.9"]
publish:
jobs:
filters:
tags:
only: /.*/
- deploy:
requires:
- test
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
+31
View File
@@ -0,0 +1,31 @@
import re
import sys
def patch(tag):
print(f"Patching version: {tag}")
with open("pyproject.toml", "r") as f:
lines = f.readlines()
if "version" not in lines[2]:
raise Exception(f"Invalid pyproject.toml. Could not patch version.")
lines[2] = f'version = "{tag}"\n'
with open("pyproject.toml", "w") as file:
file.writelines(lines)
def main():
if len(sys.argv) < 2:
return
tag = sys.argv[1]
if not re.match(r"[0-9]+(\.[0-9]+)*$", tag):
raise ValueError(f"Invalid tag provided: {tag}")
patch(tag)
if __name__ == "__main__":
main()
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "specklepy"
version = "2.2.6"
version = "2.1.0"
description = "The Python SDK for Speckle 2.0"
readme = "README.md"
authors = ["Speckle Systems <devops@speckle.systems>"]
+16 -5
View File
@@ -94,6 +94,7 @@ class StreamWrapper:
object_id: str = None
branch_name: str = None
client: SpeckleClient = None
account: Account = None
def __repr__(self):
return f"StreamWrapper( server: {self.host}, stream_id: {self.stream_id}, type: {self.type} )"
@@ -148,17 +149,27 @@ class StreamWrapper:
f"Cannot parse {url} into a stream wrapper class - no stream id found."
)
def get_account(self) -> Account:
if self.account:
return self.account
self.account = next(
(a for a in get_local_accounts() if self.host in a.serverInfo.url),
None,
)
return self.account
def get_client(self) -> SpeckleClient:
if self.client:
return self.client
acct = next(
(a for a in get_local_accounts() if self.host in a.serverInfo.url),
None,
)
if not self.account:
self.get_account()
self.client = SpeckleClient(host=self.host, use_ssl=self.use_ssl)
if not acct:
if self.account is None:
warn(f"No local account found for server {self.host}", SpeckleWarning)
return self.client
+1
View File
@@ -22,6 +22,7 @@ class Commit(BaseModel):
authorName: Optional[str]
authorId: Optional[str]
authorAvatar: Optional[str]
branchName: Optional[str]
createdAt: Optional[str]
sourceApplication: Optional[str]
referencedObject: Optional[str]
+1
View File
@@ -40,6 +40,7 @@ class Resource(ResourceBase):
authorId
authorName
authorAvatar
branchName
createdAt
sourceApplication
totalChildrenCount
+1 -1
View File
@@ -93,7 +93,7 @@ class Ellipse(Base, speckle_type=GEOMETRY + "Ellipse"):
class Polyline(Base, speckle_type=GEOMETRY + "Polyline"):
value: List[float] = None
value: List[float] = []
closed: bool = None
domain: Interval = None
bbox: Box = None