Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Convert projects to SDK style
- Convert tests to SDK style
- Delete obsolete files and add common build props
- Convert Runtime to SDK style and always use .NET Standard
- Convert console to SDK style
- Convert clrmodule to SDK style and switch to NXPorts
  • Loading branch information
filmor committed Dec 9, 2020
commit f811e510c184e312fe8820a8b32f083418c5a998
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/src/runtime/interopNative.cs

# Configuration data
configured.props

# General binaries and Build results
*.dll
*.exe
Expand All @@ -17,6 +20,7 @@ __pycache__/
build/
dist/
*.egg-info/
.eggs/

# Unit test / coverage reports
htmlcov/
Expand Down
17 changes: 17 additions & 0 deletions Directory.Build.props
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 deletions NuGet.config

This file was deleted.

25 changes: 3 additions & 22 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ platform:

environment:
global:
PYTHONUNBUFFERED: True
PYTHONUNBUFFERED: 'True'
PYTHONWARNINGS: 'ignore:::wheel.pep425tags:'
CODECOV_ENV: PYTHON_VERSION, PLATFORM

Expand Down Expand Up @@ -47,35 +47,16 @@ init:
install:
- python -m pip install -U pip
- pip install --upgrade -r requirements.txt --quiet
- pip install pycparser --quiet

# Install OpenCover. Can't put on `packages.config`, not Mono compatible
- .\tools\nuget\nuget.exe install OpenCover -OutputDirectory packages -Verbosity quiet

build_script:
- python setup.py configure
# Create clean `sdist`. Only used for releases
- python setup.py --quiet sdist
# Build `wheel` with coverage of `setup.py`
- coverage run setup.py bdist_wheel %BUILD_OPTS%
- python setup.py bdist_wheel

test_script:
- pip install --no-index --find-links=.\dist\ pythonnet
- ps: .\ci\appveyor_run_tests.ps1

on_finish:
# Temporary disable multiple upload due to codecov limit of 20 per commit.
# https://docs.codecov.io/blog/week-8-2017
- coverage xml -i
# - codecov --file coverage.xml --flags setup_windows
# - codecov --file py.coverage --flags python_tests
# - codecov --file cs.coverage --flags embedded_tests
- codecov --file py.coverage cs.coverage coverage.xml --flags setup_windows

artifacts:
- path: dist\*
- path: '.\src\runtime\bin\*.nupkg'

notifications:
- provider: Slack
incoming_webhook:
secure: 2S/t6rGHdbwoxehnvn5KgfsHrBFEtwnPD7M5olGErmz70oWFVpqoWd/EvDwh7rKZGdOTjDmpwcukc2xi5VRaGHbBAqFYS3tAdgAMrcaTNWs=
23 changes: 23 additions & 0 deletions clr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
Legacy Python.NET loader for backwards compatibility
"""

def _load():
import os, sys
import importlib.util as util

if sys.maxsize > 2 ** 32:
arch = "amd64"
else:
arch = "x86"

path = os.path.join(os.path.dirname(__file__), "pythonnet", "dlls", arch, "clr.pyd")
del sys.modules["clr"]

spec = util.spec_from_file_location("clr", path)
clr = util.module_from_spec(spec)
spec.loader.exec_module(clr)

sys.modules["clr"] = clr

_load()
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
403 changes: 0 additions & 403 deletions pythonnet.15.sln

This file was deleted.

4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Requirements for both Travis and AppVeyor
pytest
coverage
psutil

# Coverage upload
coverage
codecov

# Platform specific requirements
wheel
pycparser
setuptools
setuptools_scm
Loading