forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Stubs upload actions #4861
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
Merged
Merged
Stubs upload actions #4861
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5a22a0f
upload stubs step in actions
FoamyGuy abfeb69
remove hashes from version. upload to pypi in same step as S3
FoamyGuy 1fe3813
use scm_version for stubs. seperate stubs upload from S3 mpy-cross up…
FoamyGuy c81f3fd
Merge branch 'adafruit_main' into upload_stubs_action
FoamyGuy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,27 +8,16 @@ | |
|
||
from setuptools import setup | ||
from pathlib import Path | ||
import subprocess | ||
import re | ||
|
||
STD_PACKAGES = set(('array', 'math', 'os', 'random', 'struct', 'sys', 'ssl', 'time')) | ||
|
||
STD_PACKAGES = set(('array', 'math', 'os', 'random', 'struct', 'sys', 'ssl', 'time')) | ||
|
||
stub_root = Path("circuitpython-stubs") | ||
stubs = [p.relative_to(stub_root).as_posix() for p in stub_root.glob("*.pyi")] | ||
|
||
git_out = subprocess.check_output(["git", "describe", "--tags"]) | ||
version = git_out.strip().decode("utf-8") | ||
|
||
# Detect a development build and mutate it to be valid semver and valid python version. | ||
pieces = version.split("-") | ||
if len(pieces) > 2: | ||
# Merge the commit portion onto the commit count since the tag. | ||
pieces[-2] += "+" + pieces[-1] | ||
pieces.pop() | ||
# Merge the commit count and build to the pre-release identifier. | ||
pieces[-2] += ".dev." + pieces[-1] | ||
pieces.pop() | ||
version = "-".join(pieces) | ||
def local_scheme(version): | ||
return "" | ||
|
||
packages = set(os.listdir("circuitpython-stubs")) - STD_PACKAGES | ||
package_dir = dict((f"{package}-stubs", f"circuitpython-stubs/{package}") | ||
|
@@ -49,11 +38,11 @@ def build_package_data() -> Dict[str, List[str]]: | |
maintainer="CircuitPythonistas", | ||
maintainer_email="[email protected]", | ||
author_email="[email protected]", | ||
version=version, | ||
license="MIT", | ||
packages=list(package_data.keys()), | ||
package_data=package_data, | ||
package_dir = package_dir, | ||
setup_requires=["setuptools>=38.6.0"], | ||
setup_requires=["setuptools_scm", "setuptools>=38.6.0"], | ||
use_scm_version={"local_scheme": local_scheme}, | ||
zip_safe=False, | ||
) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks funky
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yep I think this got doubled up, it's likely I misclicked it while working through changes to merge from main. I'll make a new PR to remove the dupe