Skip to content

Commit 6866af4

Browse files
authored
Merge pull request #1 from norwegian-geotechnical-institute/develop
Develop
2 parents 3d6ee46 + 9c5374a commit 6866af4

17 files changed

Lines changed: 624 additions & 321 deletions

.github/workflows/branch.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Push
2+
on: [push]
3+
4+
jobs:
5+
test:
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
python-version: ['3.9']
10+
poetry-version: ['1.1.14']
11+
os: [ubuntu-latest]
12+
runs-on: ${{ matrix.os }}
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v3
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Run image
19+
uses: abatilo/actions-poetry@v2.1.4
20+
with:
21+
poetry-version: ${{ matrix.poetry-version }}
22+
- name: Install dependencies
23+
run: poetry install
24+
- name: Run tests
25+
run: poetry run pytest --cov=./ --cov-report=xml
26+
- name: Upload coverage to Codecov
27+
uses: codecov/codecov-action@v2
28+
code-quality:
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
python-version: ['3.9']
33+
poetry-version: ['1.1.14']
34+
os: [ubuntu-latest]
35+
runs-on: ${{ matrix.os }}
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: actions/setup-python@v3
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
- name: Run image
42+
uses: abatilo/actions-poetry@v2.1.4
43+
with:
44+
poetry-version: ${{ matrix.poetry-version }}
45+
- name: Install dependencies
46+
run: poetry install
47+
- name: Run black
48+
run: poetry run black . --check
49+
# - name: Run isort
50+
# run: poetry run isort . --check-only --profile black
51+
# - name: Run flake8
52+
# run: poetry run flake8 .
53+
- name: Run mypy
54+
run: poetry run mypy .
55+
- name: Run bandit
56+
run: poetry run bandit .
57+
- name: Run safety
58+
run: poetry run safety check
59+
- name: Check for acceptable licenses
60+
run: poetry run pip-licenses --allow-only="MIT License;BSD License;Python Software Foundation License;Apache Software License;Mozilla Public License 2.0 (MPL 2.0)"

.github/workflows/release.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
on:
3+
release:
4+
types:
5+
- created
6+
7+
jobs:
8+
publish:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version: ['3.9']
13+
poetry-version: ['1.1.14']
14+
os: [ubuntu-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-python@v3
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Run image
22+
uses: abatilo/actions-poetry@v2.1.4
23+
with:
24+
poetry-version: ${{ matrix.poetry-version }}
25+
- name: Publish
26+
env:
27+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
28+
run: |
29+
poetry config pypi-token.pypi $PYPI_TOKEN
30+
poetry publish --build

CHANGES.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# NGI Python Projector Package
1+
# NGI Python Coordinate Projector Package
2+
_2022-08-27_
3+
4+
Version 0.0.4
5+
6+
- Remove timezonefinder version requirement.
7+
- Add safety package.
28

39
_2022-03-08_
410

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Norges Geotekniske Institutt
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# NGI Projector
1+
# Coordinate Projector
22

33
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
44

5-
This is the NGI Python package for projecting koordinates.
5+
This is the Norwegian Geotechnical Institute (NGI) Python package for projecting coordinates.
6+
It is a small shim on top of the library [pyproj](https://github.com/pyproj4/pyproj) that again is an interface to
7+
[PROJ](https://proj.org/).
68

79
References:
810

9-
10-
1111
Latest releases see [CHANGES.md](CHANGES.md)
1212

1313
# Installation (end user)
1414

1515
```bash
1616

17-
pip install ngi-projector
17+
pip install coordinate-projector
1818

1919
```
2020

@@ -23,7 +23,7 @@ pip install ngi-projector
2323
### Project a point
2424

2525
```python
26-
from ngi_projector import Projector
26+
from coordinate_projector import Projector
2727

2828
projector = Projector()
2929

@@ -63,33 +63,20 @@ print(f"{projected_east=}, {projected_north=}")
6363

6464
Run in the project root folder:
6565

66-
poetry install pytest
66+
poetry shell pytest
6767

6868
Build the package wheel:
6969

7070
poetry build
7171

72-
73-
7472
# Publish
7573

76-
To publish the package to NGI's private Azure Artifacts repository set the following configuration:
77-
78-
poetry config repositories.ngi https://pkgs.dev.azure.com/ngi001/277b2f77-691a-4d92-bd89-8e7cac121676/_packaging/fieldmanager/pypi/upload
79-
80-
To publish the package to Azure Artifacts, make sure you have set up your NGI credentials.
81-
82-
You need to generate Personal Access Token (PAT). Follow
83-
[this guide](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate)
84-
for how to get a PAT via the Azure DevOps GUI. `Packaging (Read, write, & manage)` access is sufficient.
85-
86-
If you want to publish your newly built package you need to set your NGI credentials:
87-
88-
poetry config pypi-token.ngi <PAT>
89-
90-
poetry publish -r ngi
91-
9274
# TODOs
9375

9476
- Handle lines
9577
- Handle polygons
78+
79+
# Contribute
80+
81+
Please start by adding an issue before submitting any pull requests.
82+

azure-pipelines.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)