Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean CI #177

Merged
merged 2 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,37 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Install Ubuntu dependencies
run: >
sudo apt-get update -q && sudo apt-get install
--no-install-recommends -y xvfb python3-dev python3-gi
python3-gi-cairo gir1.2-gtk-3.0 libgirepository1.0-dev libcairo2-dev
intltool enchant python3-enchant

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install --upgrade keyrings.alt
if [ -f development.txt ]; then pip3 install -r development.txt; fi
if [ -f requirements.txt ]; then pip3 install -r requirements.txt; fi

- name: Install
run: |
pip3 install .

- name: Build source distribution
run: |
python3 setup.py sdist

- name: Verify internationalization
run: |
python3 setup.py build_i18n
- name: Verify icons packaging
run: |
python3 setup.py build_icons

- name: Build wheel
run: |
python3 setup.py bdist_wheel
mv dist/gourmet-*-py3-none-any.whl dist/gourmet-${GITHUB_SHA::8}-py3-none-any.whl

- name: Upload wheel
uses: actions/upload-artifact@v2
Expand Down
31 changes: 0 additions & 31 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,37 +201,7 @@ def run(self):
data_files.append((target, files_merged))


class build_icons(distutils.cmd.Command):

description = "select all icons for installation"

user_options = [('icon-dir=', 'i', 'icon directory of the source tree')]

def initialize_options(self):
self.icon_dir = None

def finalize_options(self):
if self.icon_dir is None:
self.icon_dir = os.path.join("gourmet", "data", "icons")

def run(self):
data_files = [] # TODO: What the heck is this method doing?

for size in glob.glob(os.path.join(self.icon_dir, "*")):
for category in glob.glob(os.path.join(size, "*")):
icons = []
for icon in glob.glob(os.path.join(category, "*")):
if not os.path.islink(icon):
icons.append(icon)
if icons:
data_files.append(("share/icons/hicolor/%s/%s" %
(os.path.basename(size),
os.path.basename(category)),
icons))


distutils.command.build.build.sub_commands.append(("build_i18n", None))
distutils.command.build.build.sub_commands.append(("build_icons", None))


class build_py(distutils.command.build_py.build_py):
Expand Down Expand Up @@ -520,7 +490,6 @@ def crawl_plugins(base, basename):
include_package_data=True,
cmdclass={'build': build_extra,
'build_i18n': build_i18n,
'build_icons': build_icons,
'build_py': build_py,
'build_scripts': build_scripts,
},
Expand Down