Skip to content

Commit

Permalink
Update build/package script to meet QGIS repo LICENSE requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoSander committed Jul 9, 2024
1 parent 527b970 commit 4ff3442
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
_GeoCat Bridge for QGIS_ is the light-weight open-source version of the proprietary _GeoCat Bridge for ArcGIS_ plugin.
It allows QGIS users to share geospatial (meta)data to cloud-based platforms like GeoServer, GeoNetwork, and MapServer.

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE.md) [![Join the chat at https://gitter.im/GeoCat/Bridge](https://badges.gitter.im/GeoCat/Bridge.svg)](https://gitter.im/GeoCat/Bridge?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE) [![Join the chat at https://gitter.im/GeoCat/Bridge](https://badges.gitter.im/GeoCat/Bridge.svg)](https://gitter.im/GeoCat/Bridge?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Installation

Expand Down
17 changes: 13 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,27 @@ def make_zip(zip_file):
file_excludes = {'*.pyc', "*.git*", "*.log"}
dir_excludes = {"test", "tests", "_debug", "debug", "build", "__pycache__", ".github"}
src_dir = f"./geocatbridge"
lic_txt = Path('./LICENSE.md')
gpltxt = Path('./LICENSE')
readme = Path('./README.md')

def filter_excludes(file_list):
for fn in file_list:
if not any([fnmatch(fn, e) for e in file_excludes]):
yield fn

if lic_txt.is_file():
if gpltxt.is_file():
# Include license file from repo root in package if it exists
dstpath = src_dir / lic_txt
dstpath = src_dir / gpltxt
print(f'\t{dstpath}')
zip_file.write(lic_txt.resolve(), dstpath)
zip_file.write(gpltxt.resolve(), dstpath)
else:
raise FileNotFoundError(f"Required LICENSE file is missing!")

if readme.is_file():
# Include README file from repo root in package if it exists
dstpath = src_dir / readme
print(f'\t{dstpath}')
zip_file.write(readme.resolve(), dstpath)

for root, dirs, files in os.walk(src_dir):
if any(p in dir_excludes for p in Path(root).parts):
Expand Down

0 comments on commit 4ff3442

Please sign in to comment.