Skip to content

Commit

Permalink
Merge pull request #134 from metaodi/develop
Browse files Browse the repository at this point in the history
Release 3.0.0
  • Loading branch information
metaodi authored Feb 12, 2022
2 parents 6400802 + e503f55 commit aa28e5c
Show file tree
Hide file tree
Showing 34 changed files with 4,501 additions and 3,251 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ MANIFEST
.tox
.pycache/*
.pytest_cache/*
.env
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## [Unreleased]

## [3.0.0] - 2022-02-12
### Added
- Add context manager `Changeset()` to open/close changesets
- Add `session` parameter to provide a custom http session object

### Changed
- Refactor code into several modules/files to improve maintainability
- Use `logging` module to log debug information

### Removed
- **BC-Break**: Remove `debug` parameter of OsmApi, replaced debug messages with `logging` module

### Fixed
- Added `python_requires` to setup.py to define Python 3.7 as minimum version

## [2.0.2] - 2021-11-24
### Changed
- Set `long_description` format to markdown
Expand Down Expand Up @@ -299,7 +314,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- `Fixed` for any bug fixes.
- `Security` to invite users to upgrade in case of vulnerabilities.

[Unreleased]: https://github.com/metaodi/osmapi/compare/v2.0.2...HEAD
[Unreleased]: https://github.com/metaodi/osmapi/compare/v3.0.0...HEAD
[3.0.0]: https://github.com/metaodi/osmapi/compare/v2.0.2...v3.0.0
[2.0.2]: https://github.com/metaodi/osmapi/compare/v2.0.1...v2.0.2
[2.0.1]: https://github.com/metaodi/osmapi/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/metaodi/osmapi/compare/v1.3.0...v2.0.0
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The build the documentation locally, you can use
make docs

This project uses GitHub Pages to publish its documentation.
To update the online documentation, you need to re-generate the documentation with the above command and update the `gh-pages` branch of this repository.
To update the online documentation, you need to re-generate the documentation with the above command and update the `master` branch of this repository.

## Examples

Expand All @@ -32,14 +32,14 @@ To test this library, please create an account on the [development server of Ope
### Read from OpenStreetMap

```python
import osmapi
api = osmapi.OsmApi()
print(api.NodeGet(123))
# {u'changeset': 532907, u'uid': 14298,
# u'timestamp': u'2007-09-29T09:19:17Z',
# u'lon': 10.790009299999999, u'visible': True,
# u'version': 1, u'user': u'Mede',
# u'lat': 59.9503044, u'tag': {}, u'id': 123}
>>> import osmapi
>>> api = osmapi.OsmApi()
>>> print(api.NodeGet(123))
{u'changeset': 532907, u'uid': 14298,
u'timestamp': u'2007-09-29T09:19:17Z',
u'lon': 10.790009299999999, u'visible': True,
u'version': 1, u'user': u'Mede',
u'lat': 59.9503044, u'tag': {}, u'id': 123}
```

### Constructor
Expand All @@ -56,12 +56,12 @@ Note: Each line in the password file should have the format _user:password_
### Write to OpenStreetMap

```python
import osmapi
api = osmapi.OsmApi(api="https://api06.dev.openstreetmap.org", username = u"metaodi", password = u"*******")
api.ChangesetCreate({u"comment": u"My first test"})
print(api.NodeCreate({u"lon":1, u"lat":1, u"tag": {}}))
# {u'changeset': 532907, u'lon': 1, u'version': 1, u'lat': 1, u'tag': {}, u'id': 164684}
api.ChangesetClose()
>>> import osmapi
>>> api = osmapi.OsmApi(api="https://api06.dev.openstreetmap.org", username = u"metaodi", password = u"*******")
>>> api.ChangesetCreate({u"comment": u"My first test"})
>>> print(api.NodeCreate({u"lon":1, u"lat":1, u"tag": {}}))
{u'changeset': 532907, u'lon': 1, u'version': 1, u'lat': 1, u'tag': {}, u'id': 164684}
>>> api.ChangesetClose()
```

## Note
Expand Down Expand Up @@ -93,10 +93,10 @@ To create a new release, follow these steps (please respect [Semantic Versioning

1. Adapt the version number in `osmapi/__init__.py`
1. Update the CHANGELOG with the version
1. Re-build the documentation (`make docs`)
1. Create a pull request to merge develop into master (make sure the tests pass!)
1. Create a [new release/tag on GitHub](https://github.com/metaodi/osmapi/releases) (on the master branch)
1. The [publication on PyPI](https://pypi.python.org/pypi/osmapi) happens via [GitHub Actions](https://github.com/metaodi/osmapi/actions/workflows/publish_python.yml) on every tagged commit
1. Re-build the documentation (see above) and copy the generated files to the `gh-pages` branch

## Attribution

Expand Down
4 changes: 4 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ <h2>Available Modules</h2>
<ul>
<li><a href="osmapi.html">osmapi</a></li>
<li><a href="osmapi/OsmApi.html">osmapi.OsmApi</a></li>
<li><a href="osmapi/dom.html">osmapi.dom</a></li>
<li><a href="osmapi/errors.html">osmapi.errors</a></li>
<li><a href="osmapi/http.html">osmapi.http</a></li>
<li><a href="osmapi/parser.html">osmapi.parser</a></li>
<li><a href="osmapi/xmlbuilder.html">osmapi.xmlbuilder</a></li>
</ul>
</div>
</nav>
Expand Down
6 changes: 5 additions & 1 deletion docs/osmapi.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
<h2>Submodules</h2>
<ul>
<li><a href="osmapi/OsmApi.html">osmapi.OsmApi</a></li>
<li><a href="osmapi/dom.html">osmapi.dom</a></li>
<li><a href="osmapi/errors.html">osmapi.errors</a></li>
<li><a href="osmapi/http.html">osmapi.http</a></li>
<li><a href="osmapi/parser.html">osmapi.parser</a></li>
<li><a href="osmapi/xmlbuilder.html">osmapi.xmlbuilder</a></li>
</ul>


Expand All @@ -52,7 +56,7 @@ <h1 class="modulename">

<details>
<summary>View Source</summary>
<div class="codehilite"><pre><span></span><span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;2.0.1&#39;</span>
<div class="codehilite"><pre><span></span><span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;3.0.0&#39;</span>

<span class="kn">from</span> <span class="nn">.OsmApi</span> <span class="kn">import</span> <span class="o">*</span> <span class="c1"># noqa</span>
<span class="kn">from</span> <span class="nn">.errors</span> <span class="kn">import</span> <span class="o">*</span> <span class="c1"># noqa</span>
Expand Down
Loading

0 comments on commit aa28e5c

Please sign in to comment.