Skip to content

Commit d48e69a

Browse files
Merge pull request #53 from arup-group/link-to-template
Add remaining files to align with template
2 parents 2699b81 + bf5485d commit d48e69a

File tree

8 files changed

+151
-11
lines changed

8 files changed

+151
-11
lines changed

.cruft.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"template": "https://github.com/arup-group/cookiecutter-pypackage",
3+
"commit": "fdc37ca81ad3f267199b04856722ea68648b9109",
4+
"checkout": null,
5+
"context": {
6+
"cookiecutter": {
7+
"full_name": "Fred Shone",
8+
"email": "[email protected]",
9+
"github_username": "fredshone",
10+
"repository_owner": "arup-group",
11+
"project_title": "OSMOX",
12+
"repository_name": "osmox",
13+
"package_name": "osmox",
14+
"module_name": "osmox",
15+
"project_short_description": "A tool for extracting locations and features from OpenStreetMap (OSM) data.",
16+
"upload_pypi_package": "y",
17+
"upload_conda_package": "y",
18+
"conda_channel": "city-modelling-lab",
19+
"command_line_interface": "y",
20+
"create_docker_file": "y",
21+
"create_author_file": "n",
22+
"create_jupyter_notebook_directory": "n",
23+
"open_source_license": "MIT license",
24+
"_template": "https://github.com/arup-group/cookiecutter-pypackage"
25+
}
26+
},
27+
"directory": null
28+
}

.github/workflows/docs.yml

-10
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,3 @@ jobs:
2121
uses: arup-group/actions-city-modelling-lab/.github/workflows/docs-deploy.yml@main
2222
with:
2323
deploy_type: update_latest
24-
25-
slack-notify-ci-failure:
26-
needs: [docs-test, docs-update-latest]
27-
if: always() && contains(needs.*.result, 'failure')
28-
uses: arup-group/actions-city-modelling-lab/.github/workflows/slack-notify.yml@main
29-
secrets: inherit
30-
with:
31-
result: 'failure'
32-
channel: city-modelling-feeds
33-
message: Docs Build

.github/workflows/pr-ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ jobs:
3535
lint: false
3636
pytest_args: 'tests/' # ignore example notebooks
3737
upload_to_codecov: true
38+
39+
cruft-check:
40+
uses: arup-group/actions-city-modelling-lab/.github/workflows/template-check.yml@main

.github/workflows/pre-release.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
conda-build:
10+
uses: arup-group/actions-city-modelling-lab/.github/workflows/conda-build.yml@main
11+
secrets:
12+
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
13+
with:
14+
package_name: osmox
15+
environment: pre-release
16+
17+
18+
pip-build:
19+
uses: arup-group/actions-city-modelling-lab/.github/workflows/pip-build.yml@main
20+
secrets:
21+
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
22+
with:
23+
package_name: osmox
24+
environment: pre-release
25+
26+

.github/workflows/release.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
conda-upload:
9+
uses: arup-group/actions-city-modelling-lab/.github/workflows/conda-upload.yml@main
10+
secrets:
11+
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
12+
with:
13+
package_name: osmox
14+
build_workflow: pre-release.yml
15+
environment: release
16+
17+
18+
pip-upload:
19+
uses: arup-group/actions-city-modelling-lab/.github/workflows/pip-upload.yml@main
20+
secrets:
21+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
22+
with:
23+
package_name: osmox
24+
build_workflow: pre-release.yml
25+
environment: release
26+
27+
28+
docs-stable:
29+
permissions:
30+
contents: write
31+
uses: arup-group/actions-city-modelling-lab/.github/workflows/docs-deploy.yml@main
32+
with:
33+
deploy_type: update_stable

conda.recipe/meta.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %}
2+
{% set version = load_file_regex(load_file='../src/osmox/__init__.py', regex_pattern="__version__ = \"([a-zA-Z0-9\.].*?)\"", from_recipe_dir=True) %}
3+
{% set requirements = load_file_regex(load_file='../requirements/base.txt', regex_pattern="", from_recipe_dir=True) %}
4+
{% set requirements_dev = load_file_regex(load_file='../requirements/dev.txt', regex_pattern="", from_recipe_dir=True) %}
5+
6+
package:
7+
name: {{ pyproject.project.name }}
8+
version: {{ version.group(1) }}
9+
10+
source:
11+
path: ..
12+
13+
build:
14+
# Add the line
15+
# "skip: True # [not win]" to skip all architectures **except** Windows (also remove `noarch: python` below).
16+
# "skip: True # [win]" to skip **only** Windows (also remove `noarch: python` below).
17+
script: {{ PYTHON }} -m pip install --no-deps --ignore-installed -vv .
18+
noarch: python
19+
20+
{% if "scripts" in pyproject.project.keys() %}
21+
entry_points:
22+
{% for entry, script in pyproject.project.scripts.items() %}
23+
- {{ entry }} = {{ script }}
24+
{% endfor %}
25+
{% endif %}
26+
27+
requirements:
28+
host:
29+
- python
30+
- pip
31+
{% for dep in pyproject['build-system'].requires %}
32+
- {{ dep.lower().replace(" ", "") }}
33+
{% endfor %}
34+
run:
35+
- python {{ pyproject.project['requires-python'] }}
36+
# dependencies are defined in the requirements directory.
37+
{% for dep in requirements.string.split("\n") %}
38+
- {{ dep.lower().replace(" ", "") }}
39+
{% endfor %}
40+
41+
test:
42+
source_files:
43+
- tests
44+
- pyproject.toml
45+
requires:
46+
{% for dep in requirements_dev.string.split("\n") %}
47+
- {{ dep.lower().replace(" ", "") }}
48+
{% endfor %}
49+
commands:
50+
- pytest --no-cov tests/
51+
52+
53+
about:
54+
home: {{ pyproject.project.urls.repository }}
55+
dev_url: {{ pyproject.project.urls.repository }}
56+
doc_url: {{ pyproject.project.urls.documentation }}
57+
summary: {{ pyproject.project.description }}
58+
license: {{ pyproject.project.license.text }}
59+
license_file: LICENSE

pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ where = ["src"]
6767
[tool.setuptools.package-data]
6868
# Add file globs from the source code directory if they include non-py files that should be packaged
6969
# E.g. "fixtures/**/*"
70-
osmox = []
70+
# "py.typed" is added by default. It allows `mypy` to register the package as having type hints.
71+
osmox = ["py.typed"]
7172

7273

7374
[build-system]

src/osmox/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)