Skip to content

Commit

Permalink
Merge pull request ethereum#70 from fselmo/minor-cleanup
Browse files Browse the repository at this point in the history
Do not invoke `setup.py` directly; minor refactor + cleanup
  • Loading branch information
fselmo committed Nov 30, 2022
2 parents 7b0bc76 + 7c85f95 commit be01069
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 25 deletions.
10 changes: 3 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
## What was wrong?
### What was wrong?

Issue #
Related to issue #

## How was it fixed?

Summary of approach.
### How was it fixed?

### To-Do

[//]: # (Stay ahead of things, add list items here!)
- [ ] Clean up commit history

[//]: # (For important changes that should go into the release notes please add a newsfragment file as explained here: https://github.com/ethereum/<REPO_NAME>/blob/master/newsfragments/README.md)

[//]: # (See: https://<RTD_NAME>.readthedocs.io/en/latest/contributing.html#pull-requests)
- [ ] Add entry to the [release notes](https://github.com/ethereum/<REPO_NAME>/blob/master/newsfragments/README.md)

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ clean-pyc:
find . -name '__pycache__' -exec rm -rf {} +

lint:
tox -elint
tox -e lint

lint-roll:
isort <MODULE_NAME> tests
Expand Down Expand Up @@ -83,11 +83,11 @@ release: check-bump clean
git config commit.gpgSign true
bumpversion $(bump)
git push upstream && git push upstream --tags
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
git config commit.gpgSign "$(CURRENT_SIGN_SETTING)"


dist: clean
python setup.py sdist bdist_wheel
python -m build
ls -l dist
1 change: 1 addition & 0 deletions newsfragments/70.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not invoke ``setup.py`` directly. Minor cleanup and refactors in newsfragment ``README.md`` and newsfragment validation. Minot cleanup in ``Makefile``.
4 changes: 2 additions & 2 deletions newsfragments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ commit message and PR description, which are a description of the change as
relevant to people working on the code itself.)

Each file should be named like `<ISSUE>.<TYPE>.rst`, where
`<ISSUE>` is an issue numbers, and `<TYPE>` is one of:
`<ISSUE>` is an issue number, and `<TYPE>` is one of:

* `feature`
* `bugfix`
Expand All @@ -24,5 +24,5 @@ then open up the PR first and use the PR number for the newsfragment.

Note that the `towncrier` tool will automatically
reflow your text, so don't try to do any fancy formatting. Run
`towncrier build --draft` to get a preview of what the release notes entry
`towncrier build --draft` to get a preview of what the release notes entry
will look like in the final release notes.
28 changes: 15 additions & 13 deletions newsfragments/validate_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@
import sys

ALLOWED_EXTENSIONS = {
'.breaking.rst',
'.bugfix.rst',
'.doc.rst',
'.feature.rst',
'.internal.rst',
'.misc.rst',
'.performance.rst',
'.removal.rst',
".breaking.rst",
".bugfix.rst",
".doc.rst",
".feature.rst",
".internal.rst",
".misc.rst",
".performance.rst",
".removal.rst",
}

ALLOWED_FILES = {
'validate_files.py',
'README.md',
"validate_files.py",
"README.md",
}

THIS_DIR = pathlib.Path(__file__).parent

num_args = len(sys.argv) - 1
assert num_args in {0, 1}
if num_args == 1:
assert sys.argv[1] in ('is-empty', )
assert sys.argv[1] in ("is-empty",)

for fragment_file in THIS_DIR.iterdir():

Expand All @@ -38,7 +38,9 @@
full_extension = "".join(fragment_file.suffixes)
if full_extension not in ALLOWED_EXTENSIONS:
raise Exception(f"Unexpected file: {fragment_file}")
elif sys.argv[1] == 'is-empty':
elif sys.argv[1] == "is-empty":
raise Exception(f"Unexpected file: {fragment_file}")
else:
raise RuntimeError("Strange: arguments {sys.argv} were validated, but not found")
raise RuntimeError(
f"Strange: arguments {sys.argv} were validated, but not found"
)

0 comments on commit be01069

Please sign in to comment.