- Notifications
You must be signed in to change notification settings - Fork750
Convert projects to SDK style#1209
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
12 commits Select commitHold shift + click to select a range
f811e51
Convert projects to SDK style
filmor5607205
Drop CLSCompliant attributes to get rid of warnings
filmorfabe401
Add pyparser dependency to pyproject.toml
filmor6f97bdd
Adjust clr loading and merge Mono code into one file
filmoree990b7
Adjust workflows
filmor640b497
Ignore test failing on Mono for now
filmord75cdcc
Always run configure step if dotnet modules are present
filmor6cb3fd9
Add solution items back
filmordeaf97b
Remove outdated comment
filmor916b26a
Run AppVeyor tests without coverage for now
filmor3ae7026
Split build_dotnet into its own command
filmore3f8c20
Do the clr import later to not interfere with other test imports
filmorFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
51 changes: 15 additions & 36 deletions.github/workflows/main.yml
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 |
---|---|---|
@@ -5,47 +5,23 @@ on: [ pull_request, push ] | ||
jobs: | ||
build-test: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
filmor marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: [3.6, 3.7, 3.8, 3.9] | ||
shutdown_mode: [Normal, Soft] | ||
env: | ||
PYTHONNET_SHUTDOWN_MODE: ${{ matrix.SHUTDOWN_MODE }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
@@ -54,16 +30,19 @@ jobs: | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade -r requirements.txt | ||
- name:Build andInstall | ||
run: | | ||
python setup.py configure | ||
pipinstall-v . | ||
- name: Python Tests | ||
run: pytest | ||
- name: Run Embedding tests | ||
run: dotnet test src/embed_tests/ | ||
# TODO: Run perf tests | ||
# TODO: Run tests on macos and windows as well | ||
# TODO: Run tests on Windows on .NET Framework |
4 changes: 4 additions & 0 deletions.gitignore
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
17 changes: 17 additions & 0 deletionsDirectory.Build.props
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<VersionPrefix>3.0.0</VersionPrefix> | ||
<AssemblyCopyright>Copyright (c) 2006-2020 The Contributors of the Python.NET Project</AssemblyCopyright> | ||
<AssemblyCompany>pythonnet</AssemblyCompany> | ||
<AssemblyProduct>Python.NET</AssemblyProduct> | ||
<LangVersion>7.3</LangVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> | ||
<PackageReference Include="NonCopyableAnalyzer" Version="0.6.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildThisFileDirectory)configured.props" Condition="Exists('$(MSBuildThisFileDirectory)configured.props')" /> | ||
</Project> |
7 changes: 0 additions & 7 deletionsNuGet.config
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
37 changes: 6 additions & 31 deletionsappveyor.yml
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
41 changes: 41 additions & 0 deletionsclr.py
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
Legacy Python.NET loader for backwards compatibility | ||
""" | ||
def _get_netfx_path(): | ||
import os, sys | ||
if sys.maxsize > 2 ** 32: | ||
arch = "amd64" | ||
else: | ||
arch = "x86" | ||
return os.path.join(os.path.dirname(__file__), "pythonnet", "netfx", arch, "clr.pyd") | ||
def _get_mono_path(): | ||
import os, glob | ||
paths = glob.glob(os.path.join(os.path.dirname(__file__), "pythonnet", "mono", "clr.*so")) | ||
return paths[0] | ||
def _load_clr(): | ||
import sys | ||
from importlib import util | ||
if sys.platform == "win32": | ||
path = _get_netfx_path() | ||
else: | ||
path = _get_mono_path() | ||
del sys.modules[__name__] | ||
spec = util.spec_from_file_location("clr", path) | ||
clr = util.module_from_spec(spec) | ||
spec.loader.exec_module(clr) | ||
sys.modules[__name__] = clr | ||
_load_clr() |
3 changes: 3 additions & 0 deletionspyproject.toml
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "pycparser"] | ||
build-backend = "setuptools.build_meta" |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.