Skip to content

Commit ab7dec3

Browse files
authored
Merge pull request #162 from mapillary/feat-update-release
Fix dependencies, build and release process
2 parents 71c52c3 + 805192d commit ab7dec3

File tree

8 files changed

+1156
-1238
lines changed

8 files changed

+1156
-1238
lines changed

.circleci/config.yml

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

.github/workflows/pypi-publish.yml

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,37 @@
1-
# This workflow will build the distributions with sdist, bdist_wheel, run tests, format, and lint with a single version of Python
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
41
name: Mapillary Python SDK - Publishing to PyPi
52

63
on:
74
push:
85
branches: [ main ]
96

107
jobs:
11-
build:
12-
8+
deploy:
139
runs-on: ubuntu-latest
14-
10+
environment:
11+
name: pypi
12+
url: https://pypi.org/p/notehub-py
13+
permissions:
14+
id-token: write
1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python 3.9
18-
uses: actions/setup-python@v2
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
1921
with:
20-
python-version: 3.9
22+
python-version: "3.x"
2123

2224
- name: Install dependencies
2325
run: |
2426
python3 -m pip install --upgrade pip
25-
pip install wheel build twine readme-renderer check-manifest
27+
pip install pipenv
28+
pipenv install
2629
27-
- name: Setup PyPi RC
30+
- name: Build package
2831
run: |
29-
touch ~/.pypirc
30-
cat >> ~/.pypyirc <<EOL
31-
[distutils]
32-
index-servers =
33-
pypi
34-
testpypi
32+
pipenv run python3 -m build
3533
36-
[testpypi]
37-
repository: https://test.pypi.org/legacy
38-
username = ${{ secrets.PYPI_USERNAME }}
39-
password = ${{ secrets.PYPI_PASSWORD }}
40-
41-
[pypi]
42-
username = ${{ secrets.PYPI_USERNAME }}
43-
password = ${{ secrets.PYPI_PASSWORD }}
44-
EOL
45-
46-
- name: Uploading To PyPi
47-
run: |
48-
python3 setup.py upload
49-
50-
- name: Publish a Python distribution to PyPI
34+
- name: Publish package to PyPI
5135
uses: pypa/gh-action-pypi-publish@release/v1
5236
with:
53-
user: ${{ secrets.PYPI_USERNAME }}
54-
password: ${{ secrets.PYPI_PASSWORD }}
37+
packages-dir: ./dist/

.github/workflows/pytest.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will install Python dependencies, run tests, format, and lint with a single version of Python
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
41
name: Mapillary Python SDK - PyTest Workflow
52

63
on:
@@ -15,18 +12,17 @@ jobs:
1512
runs-on: ubuntu-latest
1613

1714
steps:
18-
- uses: actions/checkout@v2
19-
- name: Set up Python 3.9
20-
uses: actions/setup-python@v2
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
2118
with:
22-
python-version: 3.9
19+
python-version: "3.x"
2320
- name: Install dependencies
2421
run: |
25-
python -m pip install --upgrade pip && make setup-dev && pip install flake8 black pytest requests mercantile vt2geojson pandas
26-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
22+
make setup-dev
2723
- name: Locally install branch's mapillary
2824
run: |
29-
make build && pip3 install -e .
25+
make build && make local-install
3026
- name: Formatting with black
3127
run: |
3228
make format
@@ -35,4 +31,4 @@ jobs:
3531
make lint
3632
- name: Test with pytest
3733
run: |
38-
make test
34+
make test

Makefile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ setup: setup-prod setup-dev
3131

3232
# # Install needed dependencies
3333
setup-prod:
34-
python -m pip install --upgrade pip
34+
python3 -m pip install --upgrade pip
3535
pip install pipenv
3636
pipenv install
3737

3838
# # Install developer dependencies
3939
setup-dev:
40-
python -m pip install --upgrade pip
40+
python3 -m pip install --upgrade pip
4141
pip install pipenv
4242
pipenv install --dev
4343

@@ -46,11 +46,11 @@ setup-dev:
4646
# # Build the package
4747
build:
4848
# Builds the package distributions
49-
pipenv run python3 setup.py sdist bdist_wheel --universal
49+
pipenv run python3 -m build
5050

5151
local-install:
5252
# Locally install mapillary - DO THIS ONLY AFTER RUNNING `make build`
53-
pipenv run pip3 install -e .
53+
pipenv run pip install -e .
5454

5555
# CODE QUALITY
5656

@@ -59,18 +59,18 @@ style: format lint
5959

6060
# # # Formatting
6161
format:
62-
@ black src/mapillary
63-
@ black tests/
62+
@ pipenv run black src/mapillary
63+
@ pipenv run black tests/
6464

6565
# # # Linting
6666
lint:
67-
@ # stop the build if there are Python syntax errors or undefined names
68-
@ flake8 src/mapillary --count --select=E9,F63,F7,F82 --show-source --statistics
69-
@ flake8 tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
67+
@ # stop the build if there are python3 syntax errors or undefined names
68+
@ pipenv run flake8 src/mapillary --count --select=E9,F63,F7,F82 --show-source --statistics
69+
@ pipenv run flake8 tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
7070

7171
@ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
72-
@ flake8 src/mapillary --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
73-
@ flake8 tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
72+
@ pipenv run flake8 src/mapillary --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
73+
@ pipenv run flake8 tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
7474

7575
# DOCUMENTATION
7676

@@ -82,7 +82,7 @@ docs-gen: docs-sphinx docs-py docs-start
8282
docs-sphinx:
8383
sphinx-apidoc -o sphinx-docs ./src/ sphinx-apidoc --full -A 'Mapillary'; cd sphinx-docs; echo "$$PYTHON_SCRIPT" >> conf.py; make markdown;
8484

85-
# # # Python Script for moving markdown from sphinx -> docusaurus
85+
# # # python3 Script for moving markdown from sphinx -> docusaurus
8686
docs-py:
8787
python3 scripts/documentation.py
8888

@@ -132,7 +132,7 @@ dump-clean:
132132

133133
# # Execute pytest on tests/
134134
test:
135-
@ pytest --log-cli-level=20
135+
@pipenv run pytest --log-cli-level=20
136136

137137
test-no-warn:
138138
@ pytest --log-cli-level=20 --disable-warnings

Pipfile

Lines changed: 20 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4,75 +4,28 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
attrs = "==21.2.0"
8-
bleach = "==3.3.0"
9-
certifi = "==2021.5.30"
10-
chardet = "==4.0.0"
11-
click = "==8.0.1"
12-
click-plugins = "==1.1.1"
13-
cligj = "==0.7.2"
14-
coverage = "==5.5"
15-
docutils = "==0.17.1"
16-
future = "==0.18.2"
17-
hypothesis = "==6.14.0"
18-
idna = "==2.10"
19-
iniconfig = "==1.1.1"
20-
mapbox-vector-tile = "==1.2.1"
21-
mercantile = "==1.2.1"
22-
munch = "==2.5.0"
23-
numpy = "==1.21.0"
24-
scipy = "==1.7.3"
25-
pkginfo = "==1.7.0"
26-
pluggy = "==0.13.1"
27-
protobuf = "==3.17.3"
28-
psutil = "==5.8.0"
29-
py = "==1.10.0"
30-
pyparsing = "==2.4.7"
31-
requests = "==2.25.1"
32-
requests-toolbelt = "==0.9.1"
33-
six = "==1.16.0"
34-
sortedcontainers = "==2.4.0"
35-
tqdm = "==4.61.1"
36-
twine = "==1.13.0"
37-
urllib3 = "==1.26.5"
38-
vt2geojson = "==0.2.1"
39-
webencodings = "==0.5.1"
40-
Pygments = "==2.9.0"
41-
haversine = "==2.3.1"
42-
python-dotenv = "==0.19.0"
43-
shapely = "==1.8.1"
44-
turfpy = "==0.0.7"
45-
geojson = "==2.5.0"
7+
mapbox-vector-tile = ">=2.1.0"
8+
mercantile = ">=1.2.1"
9+
requests = ">=2.25.1"
10+
vt2geojson = ">=0.2.1"
11+
haversine = ">=2.3.1"
12+
shapely = ">=2.1.0"
13+
turfpy = ">=0.0.7"
14+
geojson = ">=2.5.0"
4615

4716
[dev-packages]
48-
wheel = "==0.37.0"
49-
build = "==0.6.0.post1"
50-
pytest = "==6.2.4"
51-
pytest-arraydiff = "==0.3"
52-
pytest-astropy = "==0.8.0"
53-
pytest-astropy-header = "==0.1.2"
54-
pytest-cov = "==2.12.1"
55-
pytest-doctestplus = "==0.9.0"
56-
pytest-filter-subpackage = "==0.1.1"
57-
pytest-openfiles = "==0.5.0"
58-
pytest-remotedata = "==0.3.2"
59-
readme-renderer = "==29.0"
60-
appdirs = "==1.4.4"
61-
black = "==21.6b0"
62-
flake8 = "==3.9.2"
63-
mccabe = "==0.6.1"
64-
mypy-extensions = "==0.4.3"
65-
pathspec = "==0.8.1"
66-
pycodestyle = "==2.7.0"
67-
pyflakes = "==2.3.1"
68-
regex = "==2021.4.4"
69-
toml = "==0.10.2"
70-
twine = "==1.13.0"
71-
check-manifest = "==0.46"
72-
sphinx = "==5.1.1"
73-
sphinx-markdown-builder = "==0.5.4"
74-
sphinx-autodoc-typehints = "==1.12.0"
75-
python-dateutil = "*"
17+
haversine = ">=2.3.1"
18+
mercantile = ">=1.2.1"
19+
vt2geojson = ">=0.2.1"
20+
wheel = ">=0.37.0"
21+
build = ">=0.6.0.post1"
22+
pytest = ">=6.2.4"
23+
readme-renderer = ">=29.0"
24+
black = ">=21.6b0"
25+
flake8 = ">=3.9.2"
26+
twine = ">=1.13.0"
27+
sphinx = ">=5.1.1"
28+
sphinx-autodoc-typehints = ">=1.12.0"
7629
pandas = "*"
7730

7831
[pipenv]

0 commit comments

Comments
 (0)