Skip to content

Commit

Permalink
Merge pull request #30 from mvexel/0.4.1
Browse files Browse the repository at this point in the history
0.4.1
  • Loading branch information
mvexel authored May 25, 2024
2 parents d11023b + b0d64b5 commit d2a3ce6
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 31 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package
name: Publish Python Package

on:
release:
Expand All @@ -17,23 +17,18 @@ permissions:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v4
- name: Setup Python+PDM
uses: pdm-project/[email protected]
- name: Install dependencies
run: pdm sync -d
- name: Build package
run: pdm build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
21 changes: 21 additions & 0 deletions src/osmdiff/augmenteddiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,27 @@ def retrieve(self, clear_cache=False, timeout=30) -> int:
# FIXME should we catch instead?
return 0

@property
def remarks(self):
return self._remarks

@property
def timestamp(self):
return self._timestamp

@property
def sequence_number(self):
return self._sequence_number

@sequence_number.setter
def sequence_number(self, value):
try:
self._sequence_number = int(value)
except ValueError:
raise ValueError(
"sequence_number must be an integer or parsable as an integer"
)

def __repr__(self):
return "AugmentedDiff ({create} created, {modify} modified, \
{delete} deleted)".format(
Expand Down
30 changes: 17 additions & 13 deletions src/osmdiff/osmchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,26 @@ def from_xml_file(cls, path) -> "OSMChange":
xml = ElementTree.iterparse(fh, events=("start", "end"))
return cls.from_xml(xml)

@property
def sequence_number(self) -> int:
"""
Get the sequence number of the OSMChange object.
"""
return self._sequence_number

def set_sequence_number(self, sn) -> None:
"""
Set the sequence number of the OSMChange object.
:param sn: sequence number
:type sn: int
"""
self._sequence_number = int(sn)

sequence_number = property(sequence_number, set_sequence_number)
@sequence_number.setter
def sequence_number(self, value):
try:
self._sequence_number = int(value)
except ValueError:
raise ValueError(
"sequence_number must be an integer or parsable as an integer"
)

@property
def frequency(self) -> str:
return self._frequency

@frequency.setter
def frequency(self, f) -> None:
self._frequency = f

def __repr__(self):
return "OSMChange ({create} created, {modify} modified, \
Expand Down

0 comments on commit d2a3ce6

Please sign in to comment.