Skip to content
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

0.4.1 #30

Merged
merged 3 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading