Skip to content

Commit

Permalink
update sync script & patches
Browse files Browse the repository at this point in the history
  • Loading branch information
felipesanches committed Jul 18, 2023
1 parent 83db8f1 commit 09ee815
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 63 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ _version.py
venv
docs/_build
.eggs
.tox
.idea
.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ index fdd2872d..bcc954eb 100644
+ if not shutil.which("FontValidator"):
+ yield FAIL, Message(
+ "fontval-not-available",
+ "Mono runtime and/or Microsoft Font Validator" " are not available!",
+ "Mono runtime and/or Microsoft Font Validator are not available!",
+ )
+ return
+
Expand Down
10 changes: 5 additions & 5 deletions openbakery/patches/0010-Fix-pylint-superfluous-parens.patch
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ diff --git a/pyproject.toml b/pyproject.toml
index 7bc662e..e5a7daa 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -69,7 +69,6 @@ disable = [
@@ -47,7 +47,6 @@ disable = [
"raise-missing-from",
"redefined-outer-name",
"singleton-comparison",
"subprocess-run-check",
- "superfluous-parens",
"too-few-public-methods",
"too-many-arguments",
"too-many-boolean-expressions",
"undefined-loop-variable",
"unnecessary-pass",
"unused-argument",
--
2.30.2

141 changes: 84 additions & 57 deletions openbakery/sync_with_openbakery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ cd ~/fb
# Start by over-writting everything on our clean FontBakery git repo.
rsync --inplace -av --delete-excluded ~/devel/openbakery/ .

# Restore our .git
rm -rf .git
mv ../fontbakery-tmp-backup/.git .

# But the directory has the fork's name, so we move its contents and delete the directory
mkdir Lib/fontbakery/
cp Lib/openbakery/* -rf Lib/fontbakery/
Expand All @@ -53,6 +57,7 @@ git grep -rl openbakery -- ':(exclude)openbakery/' | xargs sed -i 's/miguelsousa
git grep -rl openbakery -- ':(exclude)openbakery/' | xargs sed -i 's/openbakery/fontbakery/g'
git grep -rl OpenBakery -- ':(exclude)openbakery/' | xargs sed -i 's/OpenBakery/FontBakery/g'


# fix author_email field on setup.py:
sed -i 's/miguel.sousa@adobe.com/juca@members.fsf.org/g' setup.py

Expand All @@ -66,10 +71,6 @@ sed -i 's/Miguel Sousa at miguel.sousa@adobe.com./us via the issue tracker or se

##### Now here's the patching out of the things we don't need: #####

# Restore our .git
rm -rf .git
mv ../fontbakery-tmp-backup/.git .

# We do not need the fork's logo:
rm -f data/openbakery.jpg

Expand Down Expand Up @@ -98,77 +99,103 @@ rm docs/user-guide.md
mv ../fontbakery-tmp-backup/docs .
mv ../fontbakery-tmp-backup/.readthedocs.yml .

# We still use the sphinx dependency for building the Font Bakery Read The Docs pages.
# We also use the header line
# --index-url https://pypi.python.org/simple/
# following advice from Cosimo Lupo, for the reasons described at the article at:
# https://caremad.io/posts/2013/07/setup-vs-requirement/
# More detailed info at: https://github.com/googlefonts/fontbakery/issues/2174
echo "\n=============="
echo "We still use the sphinx dependency for building the Font Bakery Read The Docs pages."
echo "We also use the header line"
echo " --index-url https://pypi.python.org/simple/"
echo " following advice from Cosimo Lupo, for the reasons described at the article at:"
echo " https://caremad.io/posts/2013/07/setup-vs-requirement/"
echo " More detailed info at: https://github.com/googlefonts/fontbakery/issues/2174"
echo ""
patch -p1 -R < openbakery/patches/0002-requirements-tests.txt.patch

# I don't want to delete the comment stating that the munkres dependency
# should actually be a fonttools dependency
echo "\n=============="
echo "I don't want to delete the comment stating that the munkres dependency"
echo " should actually be a fonttools dependency"
echo ""
patch -p1 -R < openbakery/patches/0003-requirements.txt.patch

# Renovate sounds like a good tool, but I am not ready yet to deploy it
# on the GoogleFonts github org. I would have to ask some team members first.
echo "\n=============="
echo "Renovate sounds like a good tool, but I am not ready yet to deploy it"
echo " on the GoogleFonts github org. I would have to ask some team members first."
echo ""
rm renovate.json

# Codecov also looks great, but I am a bit weary of giving it GitHub authorization
# to "Act on my behalf". I need a bit more time to think about it.
echo "\n=============="
echo "Codecov also looks great, but I am a bit weary of giving it GitHub authorization"
echo "to 'Act on my behalf'. I need a bit more time to think about it."
echo ""
rm codecov.yml
patch -p1 -R < openbakery/patches/0004-Codecov-also-looks-great-but.patch


##### A few tweaks to the CONTRIBUTING.md file: #####
# These URLs are broken:
# https://miguelsousa.github.io/fontbakery/dev-setup.html
# https://miguelsousa.github.io/fontbakery/run-tests-locally.html
#
# Projects hosted at the googlefonts github organization need a CLA signature.
# Note: We may in the future migrate FontBakery away from the googlefonts github org
# in order to more clearly signal that it is not a Google-biased project.
#
# We also improved the description of the project goals.
echo "##### A few tweaks to the CONTRIBUTING.md file: #####\n"
echo "\n=============="
echo "These URLs are broken:"
echo " https://miguelsousa.github.io/fontbakery/dev-setup.html"
echo " https://miguelsousa.github.io/fontbakery/run-tests-locally.html"
echo ""
echo "Projects hosted at the googlefonts github organization need a CLA signature."
echo "Note: We may in the future migrate FontBakery away from the googlefonts github org"
echo " in order to more clearly signal that it is not a Google-biased project."
echo ""
echo "We also improved the description of the project goals."
echo ""
patch -p1 -R < openbakery/patches/0005-fixes-to-CONTRIBUTING.md.patch


##### FontBakery's fixes that should be applied to Open Bakery as well:

# Fix for setuptools-scm, overwise package version always ends up being "0.1.dev1":
echo "\n=============="
echo "Fix for setuptools-scm, overwise package version always ends up being '0.1.dev1'"
echo ""
patch -p1 -R < openbakery/patches/0006-unshallow-fetch-for-setuptools-scm-otherwise-the-ver.patch


# Font Bakery won't remove the "check-" prefix from commands like "check-googlefonts" or "check-universal"
# on the command line because there may be other commands in the future such as "fix-something"
# as we had in the past. Those fixers were split out into the gftools project, but may be reintroduced
# later. It is good to keep the prefix, which has a purpose equivalent to a "namespace".
#
# This was discussed at:
# https://github.com/miguelsousa/openbakery/commit/489a2cc76e009a7c7a6d4bd3d4f3be1a9db641bd#commitcomment-119393361
# TODO: patch -p1 -R < openbakery/patches/0007-Removal-of-check-prefix-on-subcommands.patch


# cleanup bad-strings:
echo "\n=============="
echo "Font Bakery won't remove the 'check-' prefix from commands like 'check-googlefonts'"
echo " or 'check-universal' on the command line because there may be other commands in"
echo " the future such as 'fix-something' as we had in the past."
echo ""
echo "Those fixers were split out into the gftools project, but may be reintroduced"
echo " later. It is good to keep the prefix, which has a purpose equivalent"
echo " to a 'namespace'."
echo ""
echo "This was discussed at:"
echo "https://github.com/miguelsousa/openbakery/commit/489a2cc76e009a7c7a6d4bd3d4f3be1a9db641bd#commitcomment-119393361"
echo ""
patch -p1 -R < openbakery/patches/0007-Removal-of-check-prefix-on-subcommands.patch

echo "\n=============="
echo "Cleanup bad-strings. (TODO)"
echo ""
# TODO: patch -p1 -R < openbakery/patches/0008-fixes-to-strings.patch


# FontBakery won't change FontValidator ERROR into a FAIL.
#
# - A FAIL is a problem in a font.
# - An ERROR is a bug in the program or a bad setup, such as a missing third-party tool in the system.
#
# When FontValidator is not installed, it is treated as a bad system setup, thus, it is classified as an ERROR. It is not a FAIL because it is not a font problem.
#
# This was discussed at https://github.com/miguelsousa/openbakery/issues/30#issuecomment-1600765260
# TODO: patch -p1 -R < openbakery/patches/0009-FontBakery-won-t-change-FontValidator-ERROR-into-a-F.patch


# "Fix pylint superfluous-parens" --- Commit rejected to foster better code legibility
# https://github.com/miguelsousa/openbakery/commit/578bd555d51fbebc5c05b634d6a7fde8befe35ac
echo "\n=============="
echo "FontBakery won't change FontValidator ERROR into a FAIL."
echo ""
echo " - A FAIL is a problem in a font."
echo " - An ERROR is a bug in the program or a bad setup, such as a missing third-party tool in the system."
echo ""
echo "When FontValidator is not installed, it is treated as a bad system setup, thus,"
echo " it is classified as an ERROR. It is not a FAIL because it is not a font problem."
echo ""
echo "This was discussed at:"
echo "https://github.com/miguelsousa/openbakery/issues/30#issuecomment-1600765260"
echo ""
patch -p1 -R < openbakery/patches/0009-FontBakery-won-t-change-FontValidator-ERROR-into-a-F.patch


echo "\n=============="
echo "\"Fix pylint superfluous-parens\" --- Commit rejected to foster better code legibility"
echo "https://github.com/miguelsousa/openbakery/commit/578bd555d51fbebc5c05b634d6a7fde8befe35ac"
echo ""
patch -p1 -R < openbakery/patches/0010-Fix-pylint-superfluous-parens.patch


# "Delete get_regular method" --- Commit rejected to foster better code legibility
# https://github.com/miguelsousa/openbakery/commit/799c11e36c5f88e89a6eda29f3c545bddfa55135
echo "\n=============="
echo "\"Delete get_regular method\" --- Commit rejected to foster better code legibility"
echo "https://github.com/miguelsousa/openbakery/commit/799c11e36c5f88e89a6eda29f3c545bddfa55135"
echo ""
patch -p1 -R < openbakery/patches/0011-Delete-get_regular-method.patch

echo "\n=============="
echo "DONE!\n=============="

0 comments on commit 09ee815

Please sign in to comment.