Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Expand CI, enable windows testing #6

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 1 commit into from
Jan 10, 2025
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
2 changes: 1 addition & 1 deletion 2 .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changes here will be overwritten by Copier
_commit: 81e8acd
_src_path: git@github.com:python-project-templates/base.git
_src_path: https://github.com/python-project-templates/base.git
add_extension: python
email: t.paine154@gmail.com
github: python-project-templates
Expand Down
18 changes: 13 additions & 5 deletions 18 .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9"]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -56,7 +56,15 @@ jobs:

- name: Test
run: make coverage

if: matrix.os != 'windows-latest'

- name: Test
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
make coverage
shell: cmd
if: matrix.os == 'windows-latest'

- name: Upload test results (Python)
uses: actions/upload-artifact@v4
with:
Expand All @@ -68,7 +76,7 @@ jobs:
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: '**/junit.xml'
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'

- name: Upload coverage
uses: codecov/codecov-action@v5
Expand All @@ -82,4 +90,4 @@ jobs:
with:
name: dist-${{matrix.os}}
path: dist
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
2 changes: 1 addition & 1 deletion 2 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ deep-clean: ## clean everything from the repository
git clean -fdx

clean: ## clean the repository
rm -rf .coverage coverage cover htmlcov logs build dist *.egg-info
rm -rf .coverage coverage cover htmlcov logs build dist *.egg-info hatch_cpp/tests/*/dist hatch_cpp/tests/*/build hatch_cpp/tests/*/*/*.so hatch_cpp/tests/*/*/*.pyd

############################################################################################

Expand Down
7 changes: 5 additions & 2 deletions 7 hatch_cpp/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ def initialize(self, version: str, _: dict[str, t.Any]) -> None:
libraries = [HatchCppLibrary(**library_kwargs) for library_kwargs in library_kwargs]
platform = HatchCppPlatform.default()
if config.toolchain == "raw":
# g++ basic-project/basic.cpp -I. -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11/ -undefined dynamic_lookup -fPIC -shared -o extension.so
build_plan = HatchCppBuildPlan(libraries=libraries, platform=platform)
build_plan.generate()
build_plan.execute(verbose=config.verbose)
if config.verbose:
for command in build_plan.commands:
self._logger.info(command)
build_plan.execute()

# build_kwargs = config.build_kwargs
# if version == "editable":
# build_kwargs = config.editable_build_kwargs or build_kwargs
Expand Down
7 changes: 2 additions & 5 deletions 7 hatch_cpp/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@
flags += " " + " ".join(f"/LIBPATH:{lib}" for lib in library.library_dirs)
flags += " " + " ".join(f"/D{macro}" for macro in library.define_macros)
flags += " " + " ".join(f"/U{macro}" for macro in library.undef_macros)
flags += f" /Fo{library.name}.obj"
flags += f" /Fe{library.name}.pyd"
flags += f" /Fo{library.name}.pyd"

Check warning on line 120 in hatch_cpp/structs.py

View check run for this annotation

Codecov / codecov/patch

hatch_cpp/structs.py#L120

Added line #L120 was not covered by tests
# clean
while flags.count(" "):
flags = flags.replace(" ", " ")
Expand All @@ -138,9 +137,7 @@
self.commands.append(f"{self.platform.cc} {' '.join(library.sources)} {flags}")
return self.commands

def execute(self, verbose: bool = True):
def execute(self):
for command in self.commands:
if verbose:
print(f"Running command: {command}")
system(command)
return self.commands
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.