Skip to content

Commit

Permalink
fix data file inclusion in source distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Nov 8, 2019
1 parent 6c86fbf commit ce98a86
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __pycache__/
# Distribution / packaging
.Python
env/
data/
build/
develop-eggs/
dist/
Expand Down Expand Up @@ -58,13 +59,6 @@ docs/_build/
# PyBuilder
target/

# Manpages
gallery-dl.1
gallery-dl.conf.5

# Bash completion
gallery-dl.bash_completion

# Snap packaging specific
/snap/.snapcraft/
/parts/
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased
### Fixes
- Fix inclusion of bash completion and man pages in source distributions

## 1.11.0 - 2019-11-08
### Additions
- Support for
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ all: man completion docs/supportedsites.rst

clean:
$(RM) -r build/
$(RM) -r data/

install: man completion
$(PYTHON) setup.py install
Expand All @@ -23,20 +24,20 @@ test:
executable:
scripts/pyinstaller.py

completion: build/completion/gallery-dl
completion: data/completion/gallery-dl

man: build/man/gallery-dl.1 build/man/gallery-dl.conf.5
man: data/man/gallery-dl.1 data/man/gallery-dl.conf.5

.PHONY: all clean install release test executable completion man

docs/supportedsites.rst: gallery_dl/*/*.py scripts/supportedsites.py
$(PYTHON) scripts/supportedsites.py

build/man/gallery-dl.1: gallery_dl/option.py gallery_dl/version.py scripts/man.py
data/man/gallery-dl.1: gallery_dl/option.py gallery_dl/version.py scripts/man.py
$(PYTHON) scripts/man.py

build/man/gallery-dl.conf.5: docs/configuration.rst gallery_dl/version.py scripts/man.py
data/man/gallery-dl.conf.5: docs/configuration.rst gallery_dl/version.py scripts/man.py
$(PYTHON) scripts/man.py

build/completion/gallery-dl: gallery_dl/option.py scripts/bash_completion.py
data/completion/gallery-dl: gallery_dl/option.py scripts/bash_completion.py
$(PYTHON) scripts/bash_completion.py
2 changes: 1 addition & 1 deletion gallery_dl/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.

__version__ = "1.11.0"
__version__ = "1.11.1-dev"
2 changes: 1 addition & 1 deletion scripts/bash_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
if opt.startswith("--"):
opts.append(opt)

PATH = util.path("build/completion/gallery-dl")
PATH = util.path("data/completion/gallery-dl")
with open(PATH, "w", encoding="utf-8") as file:
file.write(TEMPLATE % {
"opts" : " ".join(opts),
Expand Down
4 changes: 2 additions & 2 deletions scripts/man.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def build_gallery_dl_1(path=None):
))

if not path:
path = util.path("build/man/gallery-dl.1")
path = util.path("data/man/gallery-dl.1")
with open(path, "w", encoding="utf-8") as file:
file.write(TEMPLATE.lstrip() % {
"options": "\n".join(options),
Expand Down Expand Up @@ -217,7 +217,7 @@ def build_gallery_dl_conf_5(path=None):
content.append(strip_rst(text, field != "Example"))

if not path:
path = util.path("build/man/gallery-dl.conf.5")
path = util.path("data/man/gallery-dl.conf.5")
with open(path, "w", encoding="utf-8") as file:
file.write(TEMPLATE.lstrip() % {
"options": "\n".join(content),
Expand Down
1 change: 1 addition & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ update() {

sed -i "s#\"${PYVERSION}\"#\"${NEWVERSION}\"#" "gallery_dl/version.py"
sed -i "s#v${OLDVERSION}#v${NEWVERSION}#" "${README}"
make man
}

update-dev() {
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def check_file(fname):
FILES = [
(path, [f for f in files if check_file(f)])
for (path, files) in [
("share/bash-completion/completions", ["build/completion/gallery-dl"]),
("share/man/man1" , ["build/man/gallery-dl.1"]),
("share/man/man5" , ["build/man/gallery-dl.conf.5"]),
("share/bash-completion/completions", ["data/completion/gallery-dl"]),
("share/man/man1" , ["data/man/gallery-dl.1"]),
("share/man/man5" , ["data/man/gallery-dl.conf.5"]),
]
]

Expand Down

0 comments on commit ce98a86

Please sign in to comment.