Skip to content

Commit

Permalink
Merge pull request #124 from metaodi/develop
Browse files Browse the repository at this point in the history
Release 2.0.1
  • Loading branch information
metaodi authored Nov 24, 2021
2 parents 6938b79 + fbe972f commit 2426c04
Show file tree
Hide file tree
Showing 24 changed files with 10,861 additions and 416 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build osmapi
on:
pull_request:
push:
branches: [master]
branches: [master, develop]
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -30,9 +30,3 @@ jobs:
- name: Build the package
run: ./build.sh

- name: Test coverage
run: coveralls --service=github
if: ${{ matrix.python-version == '3.8' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ MANIFEST
.coverage
.tox
.pycache/*
.pytest_cache/*
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## [Unreleased]

## [2.0.1] - 2021-11-23
### Added
- Add Makefile for all common tasks

### Fixed
- Long description of osmapi (now using directly the README.md)

### Changed
- Switch from nose to pytest
- Move docs to its own subdirectory

### Removed
- Remove tox configuration and dependency

## [2.0.0] - 2021-11-22
### Added
- Move from Travis CI to Github Actions
Expand Down Expand Up @@ -281,7 +295,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.0...HEAD
[Unreleased]: https://github.com/metaodi/osmapi/compare/v2.0.1...HEAD
[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
[1.3.0]: https://github.com/metaodi/osmapi/compare/v1.2.2...v1.3.0
[1.2.2]: https://github.com/metaodi/osmapi/compare/v1.2.1...v1.2.2
Expand Down
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.DEFAULT_GOAL := help
.PHONY: coverage deps help lint test docs

coverage: ## Run tests with coverage
python -m coverage erase
python -m coverage run --include=osmapi/* -m pytest -ra
python -m coverage report -m

deps: ## Install dependencies
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r test-requirements.txt

docs: ## Generate documentation
python -m pdoc -o docs osmapi

lint: ## Linting of source code
python -m flake8 --statistics --show-source .

test: ## Run tests
python -m pytest --cov=osmapi tests/

help: SHELL := /bin/bash
help: ## Show help message
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/:/'`); \
printf "%s\n\n" "Usage: make [task]"; \
printf "%-20s %s\n" "task" "help" ; \
printf "%-20s %s\n" "------" "----" ; \
for help_line in $${help_lines[@]}; do \
IFS=$$':' ; \
help_split=($$help_line) ; \
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
printf '\033[36m'; \
printf "%-20s %s" $$help_command ; \
printf '\033[0m'; \
printf "%s\n" $$help_info; \
done
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ After that, it is recommended to install the `flake8` pre-commit-hook:

To run the tests use the following command:

nosetests --verbose

By using tox you can even run the tests against different versions of python (3.7, 3.8, 3.9):

tox
pytest

## Release

Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ function cleanup {
trap "cleanup" EXIT

# Check PEP-8 code style and McCabe complexity
flake8 --statistics --show-source .
make lint

# run tests
nosetests --verbose --with-coverage
make test

# generate the docs
pdoc -o . osmapi
make docs

# setup a new virtualenv and try to install the lib
virtualenv pyenv
Expand Down
228 changes: 228 additions & 0 deletions docs/index.html

Large diffs are not rendered by default.

233 changes: 233 additions & 0 deletions docs/osmapi.html

Large diffs are not rendered by default.

8,697 changes: 8,697 additions & 0 deletions docs/osmapi/OsmApi.html

Large diffs are not rendered by default.

1,191 changes: 1,191 additions & 0 deletions docs/osmapi/errors.html

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions docs/search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion osmapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.0.0'
__version__ = '2.0.1'

from .OsmApi import * # noqa
from .errors import * # noqa
4 changes: 0 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This file lists the dependencies of this extension.
# Install with a command like: pip install -r pip-requirements.txt
pdoc==8.0.1
Pygments==2.10.0
pypandoc==1.6.4
requests==2.26.0
Unidecode==1.3.2
16 changes: 5 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

from codecs import open
from setuptools import setup
from setuptools import setup, find_packages
import re

with open('osmapi/__init__.py', 'r') as fd:
Expand All @@ -11,22 +11,16 @@
if not version:
raise RuntimeError('Cannot find version information')

try:
import pypandoc
from unidecode import unidecode
description = open('README.md', encoding='utf-8').read()
description = unidecode(description)
description = pypandoc.convert(description, 'rst', format='md')
except (IOError, OSError, ImportError):
description = 'Python wrapper for the OSM API'
with open('README.md', 'r', encoding="utf-8") as f:
long_description = f.read()

setup(
name='osmapi',
packages=['osmapi'],
packages=find_packages(),
version=version,
install_requires=['requests'],
description='Python wrapper for the OSM API',
long_description=description,
long_description=long_description,
author='Etienne Chové',
author_email='[email protected]',
maintainer='Stefan Oderbolz',
Expand Down
7 changes: 3 additions & 4 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
coverage
coveralls
flake8
mock
nose
tox
virtualenv
xmltodict
pytest
pytest-cov
coverage
6 changes: 3 additions & 3 deletions tests/capabilities_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from __future__ import (unicode_literals, absolute_import)
from . import osmapi_tests
from . import osmapi_test


class TestOsmApiNode(osmapi_tests.TestOsmApi):
class TestOsmApiNode(osmapi_test.TestOsmApi):
def test_Capabilities(self):
self._session_mock()

result = self.api.Capabilities()
self.assertEquals(result, {
self.assertEqual(result, {
'area': {'maximum': 0.25},
'changesets': {'maximum_elements': 50000.0},
'status': {
Expand Down
Loading

0 comments on commit 2426c04

Please sign in to comment.