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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
310d50d
Use string interpolation
vmuriart Feb 9, 2017
a2e8d46
Replace PyString_FromStringAndSize usage to PyString_FromString
vmuriart Feb 9, 2017
54841da
Fix xml-docs build warnings
vmuriart Feb 13, 2017
a5d325f
Refactor AppVeyor/Travis embedded test_runner
vmuriart Feb 13, 2017
ba7794b
Add pytest to CI
vmuriart Jan 13, 2017
1ea29c7
Convert unittest to pytest
vmuriart Jan 15, 2017
104ef71
Add setup.cfg
vmuriart Jan 23, 2017
76aa731
Simpler tox
vmuriart Jan 29, 2017
13e2a87
Merge pull request #368 from vmuriart/pytest
vmuriart Feb 14, 2017
adc927f
Upgrade NUnit to 3.6
vmuriart Feb 8, 2017
5f86154
Fix coverage w NUnit3; add OpenCover filter
vmuriart Feb 13, 2017
a343b34
Remove check-manifest
vmuriart Feb 14, 2017
ce40fb1
Add overload tests from #131
vmuriart Feb 14, 2017
8add8d1
Refactor converter.cs & methodbind*.cs (#375)
vmuriart Feb 14, 2017
d7942c8
Merge pull request #371 from vmuriart/nunit3_6
vmuriart Feb 14, 2017
a019017
Cleanup/Comment Python.Runtime.dll.config & travis
vmuriart Feb 14, 2017
5ad3408
Add LD_LIBRARY_PATH to travis env
vmuriart Feb 14, 2017
31f0b30
Find dll for PY2 travis embedded tests
vmuriart Feb 14, 2017
fcd1cd2
Generalize LD_LIBRARY_PATH
vmuriart Feb 14, 2017
49c85b4
Merge branch 'travis-find_dll' into pythonnet_master
vmuriart Feb 14, 2017
6afc9e6
Add GetPrecedence reference
vmuriart Feb 14, 2017
8f30a39
Use builtin miniconda
vmuriart Feb 15, 2017
1bd8636
Update version (#379)
Feb 15, 2017
08c2d64
StackOverflow/Slack shields (#384)
Feb 16, 2017
0f00e3a
Slack integration for Travis and Appveyor (#386)
filmor Feb 16, 2017
4ecde5b
Simplify LD_LIBRARY_PATH on Travis
vmuriart Feb 16, 2017
c64e34e
Rename NUnit vars to generic names
vmuriart Feb 16, 2017
1d7e784
Remove python test STDERR redirect
vmuriart Feb 16, 2017
433dc33
Clean-up AppVeyor build recipe
vmuriart Feb 16, 2017
d319f4e
Add requirements.txt and pytest options
vmuriart Feb 16, 2017
5ead8ef
Quiet sdist output & update comments on AppVeyor
vmuriart Feb 16, 2017
da940f5
Add pytest header info & remove unused fixtures
vmuriart Feb 16, 2017
99e04c5
Move Conda env to PowerShell recipe script
vmuriart Feb 16, 2017
d77f933
Use Codecov report flags
vmuriart Feb 16, 2017
df59d0f
Clean-up CI configs
vmuriart Feb 17, 2017
b23acab
Merge branch 'ci'
vmuriart Feb 17, 2017
94c266e
Update CHANGELOG
vmuriart Feb 17, 2017
1d583c7
Pass arbitrary .NET object as value of an attr of PyObject by dyn typ…
yagweb Feb 17, 2017
2cb6742
Add Coverity badge
vmuriart Feb 17, 2017
3212cfe
Clean-up CHANGELOG
vmuriart Feb 20, 2017
f6d176c
Standardize Python.Test fixture location
vmuriart Feb 21, 2017
c0fb3f2
Add unittest for Overflow/across AppDomains Exceptions reproduction (…
yagweb Feb 21, 2017
2871d1b
Re-order Initialize tests
vmuriart Feb 21, 2017
bd1a27e
Add documentation and ref to ReInitialize test
vmuriart Feb 21, 2017
38af8d1
Split and re-order TestPyTupleIsTupleType test
vmuriart Feb 21, 2017
e75d1c2
Skip PyTuple test with AppDomain issue
vmuriart Feb 21, 2017
04ce393
Merge branch 'embedded_tests' into pythonnet_master
vmuriart Feb 21, 2017
e7c94df
Clean-up embedded tests
vmuriart Feb 21, 2017
c99c5f2
Fix conda build log stderr->stdout
vmuriart Feb 21, 2017
5e27c67
Quiet AppVeyor pip/nuget installs
vmuriart Feb 21, 2017
cbafe1e
Allow private env:var to force conda build
vmuriart Feb 21, 2017
e753b72
Update AUTHORS
vmuriart Feb 21, 2017
3c69371
Rename TearDown to Dispose
vmuriart Feb 21, 2017
a9e2fe7
Relocate Embedded tests fixtures
vmuriart Feb 21, 2017
02a8a34
Update LICENSE year & include in recipe
vmuriart Feb 22, 2017
0e5e58e
Update conda-recipe version
vmuriart Feb 21, 2017
928717d
Add SharedAssemblyInfo & Update Assembly version
vmuriart Feb 22, 2017
5a7d297
Add .bumpversion
vmuriart Feb 22, 2017
909b7c0
Merge pull request #398 from vmuriart/bumpversion
vmuriart Feb 22, 2017
b7a3c7e
Add object overload test
vmuriart Apr 18, 2016
2cabc9f
Add object type to methodbind
vmuriart May 22, 2016
4071aa3
Add more object overload method tests
vmuriart Feb 15, 2017
8f258ac
Merge pull request #377 from vmuriart/method_object
vmuriart Feb 22, 2017
9e3193b
Update CHANGELOG
vmuriart Feb 22, 2017
b21fab9
Enable embedded_tests to Travis w. conditional filters
vmuriart Feb 21, 2017
3cb531a
Split blank DefineConstants on `*.csproj`
vmuriart Feb 22, 2017
d86880a
Update CHANGELOG
vmuriart Feb 22, 2017
edc7621
Fix PythonException GC (#400)
vmuriart Feb 23, 2017
ea44eef
Add Eval(...) and Exec(...)
yagweb Feb 17, 2017
2dfff9f
Keep RunString Public. Fix Assert.AreEqual order
vmuriart Feb 23, 2017
9bf4239
Merge pull request #389 from yagweb/add_eval
vmuriart Feb 24, 2017
e8c2294
Update CHANGELOG
vmuriart Feb 24, 2017
2b6f815
Clarify MashalAs on runtime.cs
vmuriart Feb 24, 2017
ecd7e60
Fix runtime Initialize dll nameclash
vmuriart Feb 24, 2017
012b488
Update test_sysargv
vmuriart Feb 24, 2017
faf5faf
Fix the issue of sys.argv being cleared on import clr.
filmor Feb 24, 2017
c5c8e57
improve tests.pyproj for intellisense and running tests (#395)
Feb 24, 2017
db6c1b2
Add case-sensitivity tests
vmuriart Feb 24, 2017
30be9c9
Added branching for ldd command in OSX (#406)
fractus Feb 24, 2017
b4ed645
Minor style clean-up runtime/pythonengine
vmuriart Feb 25, 2017
8ff338a
Fix Py_Main/PySys_SetArgvEx(...) UCS4/PY3 no mem
dmitriyse Feb 22, 2017
9b70892
Update CHANGELOG, remove extra MarshalAs
vmuriart Feb 25, 2017
289d29d
Merge pull request #399 from vmuriart/fix-pymain_setargv-py3ucs4
vmuriart Feb 26, 2017
9e85489
Move PythonBuildDir when not defined
vmuriart Feb 26, 2017
f2519f7
Update ARCH check
vmuriart Feb 26, 2017
cef6153
Enable TestPyTupleInvalidAppend test
vmuriart Feb 27, 2017
5070db0
Add tests/refactor existing
vmuriart Feb 27, 2017
7dba617
Set language version to 6
vmuriart Feb 27, 2017
6667669
Add ICustomMarshaler StrMarshaler
vmuriart Feb 25, 2017
d01f25f
Add ICustomMarshaler StrArrayMarshaler
vmuriart Feb 25, 2017
74440a6
Refactor Marshals
vmuriart Feb 25, 2017
e487076
Add ICustomMarshaler Utf8Marshaler
vmuriart Feb 25, 2017
ccd4521
Match PyUnicode_AsUnicode signature in UCS2/UCS4
vmuriart Feb 26, 2017
07f87de
Refactor GetManagedString
vmuriart Feb 26, 2017
edafdf2
Remove internal PyUnicode_AS_UNICODE
vmuriart Feb 26, 2017
78939c5
Refactor Encoding check
vmuriart Feb 26, 2017
01a35cb
Merge pull request #407 from vmuriart/custom_marshal
vmuriart Feb 28, 2017
7114393
Remove ExactSpelling
vmuriart Feb 24, 2017
1fef331
Remove CharSet.Ansi
vmuriart Feb 24, 2017
ef7f69f
Remove CharSet.Unicode where not needed
vmuriart Feb 24, 2017
f1aa89b
Remove CallingConvention
vmuriart Feb 24, 2017
5b3f58a
Rename Runtime field `dll` to `PythonDll`
vmuriart Feb 26, 2017
67b3181
Merge pull request #403 from vmuriart/Clean-DllImport
vmuriart Feb 28, 2017
c890691
Remove unneeded unsafe keyword
vmuriart Feb 28, 2017
59733ea
Update CHANGELOG
vmuriart Feb 28, 2017
46660fa
Add Runtime.CheckExceptionOccurred(...)
vmuriart Feb 28, 2017
4616921
Replace Py.Throw with Runtime.CheckExceptionOccurred
vmuriart Feb 28, 2017
6095de8
Whitespace clean-up Runtime
vmuriart Feb 28, 2017
c7b4c21
Apply consistent name qualification to runtime.cs
vmuriart Mar 1, 2017
6e9fed9
Unify PY3 UCS2/UCS4 unicode methods
vmuriart Mar 1, 2017
464080f
Unify PY2 UCS2/UCS4 unicode methods
vmuriart Mar 1, 2017
0fdb80a
Rename internal methods to proper Python API name
vmuriart Mar 1, 2017
423407a
Merge branch 'unify-unicode'
vmuriart Mar 1, 2017
9650e8b
Fix PY27 dll mapping in Linux/macOS
vmuriart Mar 1, 2017
044edfe
Refactor runtime's dllBase
vmuriart Mar 1, 2017
445531d
Style clean-up runtime.cs
vmuriart Mar 1, 2017
3a7d56b
Temporary disable Codecov flags
vmuriart Mar 1, 2017
5036586
Fix test_multiple_calls_to_initialize
vmuriart Mar 2, 2017
6f3f357
Fix PythonEngine.Version
vmuriart Mar 2, 2017
e200cae
Add PYTHONPATH/PYTHONHOME default value tests
vmuriart Mar 2, 2017
0cfc67a
Fix get PYTHONHOME/PYTHONPATH marshal
vmuriart Mar 2, 2017
ffe6448
Rename internal StrMarshaler to UcsMarshaler
vmuriart Mar 2, 2017
9449a04
Merge branch 'fix-getPythonPath'
vmuriart Mar 2, 2017
f4c2ca2
Unset PYTHONHOME in AppVeyor
vmuriart Mar 3, 2017
0a47802
Update conda
vmuriart Mar 3, 2017
6668ebf
Fix PythonEngine PYTHONHOME setter
vmuriart Mar 2, 2017
321aa28
Fix set PythonPath, set ProgramName
vmuriart Mar 2, 2017
365cd6e
Merge pull request #415 from vmuriart/fix_PYTHONHOME
vmuriart Mar 3, 2017
3225465
Deprecate public RunString
vmuriart Mar 3, 2017
a14ff14
Combine Py_DEBUG and PYTHON_WITH_PYDEBUG flags
vmuriart Mar 3, 2017
8fba051
Remove PYTHON_WITH_WIDE_UNICODE flag
vmuriart Mar 3, 2017
85c85f2
Refactor PY2/PY3 Marshal in/out String/Unicode
vmuriart Mar 3, 2017
895516e
Refactor runtime.cs
vmuriart Mar 3, 2017
6d08374
Merge branch 'refactor'
vmuriart Mar 4, 2017
7db41a9
Fix Py_SetPath not available in PY2
vmuriart Mar 3, 2017
563f6a6
Calculate Runtime fields before Initialization
vmuriart Mar 3, 2017
92996a1
Add timing to detect slow tests on pytest
vmuriart Mar 4, 2017
305040d
Rename test classes/files
vmuriart Mar 5, 2017
de3874c
Add PyTuple Ctor tests
vmuriart Mar 5, 2017
d7777b9
Define and document Py_IncRef/Py_DecRef
vmuriart Mar 6, 2017
977ee96
Add Tests
vmuriart Mar 6, 2017
6e4cf9d
Refactor Exception checking on tested classes
vmuriart Mar 6, 2017
657d674
Clean-up Embedded tests
vmuriart Mar 6, 2017
8ce4e0e
Add PyList tests
vmuriart Mar 6, 2017
ae8e6f0
Add test for pyscript global variable casting
vmuriart Mar 7, 2017
898e13e
Clean-up README.md example
vmuriart Mar 8, 2017
7d457ef
Fix typo in README
vmuriart Mar 8, 2017
21d1636
Update CHANGELOG.md
Mar 11, 2017
c3b59db
Bump version: 2.3.0.dev1 → 2.3.0 release
vmuriart Mar 11, 2017
51ec8a4
Bump version: 2.3.0.→ 2.4.0.dev0
vmuriart Mar 11, 2017
d40a2dc
Build conda recipe on new tags
vmuriart Mar 11, 2017
4df6105
Fix numpy array and README example (#427)
vmuriart Mar 14, 2017
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
29 changes: 29 additions & 0 deletions 29 .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[bumpversion]
current_version = 2.4.0.dev0
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
serialize =
{major}.{minor}.{patch}.{release}{dev}
{major}.{minor}.{patch}

[bumpversion:part:release]
optional_value = dummy
values =
dev
dummy

[bumpversion:part:dev]

[bumpversion:file:setup.py]

[bumpversion:file:conda.recipe/meta.yaml]

[bumpversion:file:src/runtime/resources/clr.py]

[bumpversion:file:src/SharedAssemblyInfo.cs]
serialize =
{major}.{minor}.{patch}

[bumpversion:file:src/clrmodule/ClrModule.cs]
serialize =
{major}.{minor}.{patch}

7 changes: 6 additions & 1 deletion 7 .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ trim_trailing_whitespace = true
indent_size = 2

# Xml project files
[*.{csproj,config,build,config}]
[*.{csproj,pyproj,config}]
indent_size = 2

# Solution
[*.sln]
indent_style = tab

# bumpversion reformats itself after every bump
[.bumpversion.cfg]
trim_trailing_whitespace = false
indent_style = tab
3 changes: 3 additions & 0 deletions 3 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ _UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# Coverity
cov-int/
24 changes: 16 additions & 8 deletions 24 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
- SEGFAULT_SIGNALS=all
- PYTHONUNBUFFERED=True
- CODECOV_ENV=TRAVIS_PYTHON_VERSION

addons:
apt:
Expand All @@ -28,21 +29,28 @@ addons:
- mono-devel
- ca-certificates-mono

before_install:
# Set-up dll path for embedded tests
- PY_LIBDIR=$(python -c 'import sysconfig; print(sysconfig.get_config_var("LIBDIR"))')
- export LD_LIBRARY_PATH=$PY_LIBDIR:$LD_LIBRARY_PATH

install:
- pip install pycparser coverage codecov
- coverage run setup.py build_ext --inplace
- pip install --upgrade -r requirements.txt
- coverage run setup.py install

script:
- export PYTHONPATH=`pwd`:$PYTHONPATH
- python src/tests/runtests.py
# - mono ./packages/NUnit.Runners*/tools/nunit-console.exe src/embed_tests/bin/Python.EmbeddingTest.dll
- python -m pytest
- mono ./packages/NUnit.*/tools/nunit3-console.exe src/embed_tests/bin/Python.EmbeddingTest.dll

after_success:
after_script:
# Uncomment if need to geninterop, ie. py37 final
# - python tools/geninterop/geninterop.py

# Waiting on mono-cov support or SharpCover
- codecov
# Waiting on mono-coverage, SharpCover or xr.Baboon
- coverage xml -i
- codecov --file coverage.xml --flags setup_linux

notifications:
email: false
slack:
secure: "UiQdSK1/uNnHl8/gQgfLj/F5JGxtJuaT3QYtKNcw3Ddpr3FX8tfXJ/RjsCsSlRQzDm7AdBAeMzcBQmvH4iRIV2y7qVywLyru5MPiwY4ZjMN6fJK/zaaxetOct9fasIBYzHguNPDAtiBGFh2iK1H1MXTY8rkmU3WZvl18b8EsrP0="
7 changes: 4 additions & 3 deletions 7 AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@

## Contributors

- Arvid JB ([@ArvidJB](https://github.com/ArvidJB))
- Bradley Friedman ([@leith-bartrich](https://github.com/leith-bartrich))
- Christian Heimes ([@tiran](https://github.com/tiran))
- Christoph Gohlke ([@cgohlke](https://github.com/cgohlke))
- Daniel Fernandez ([@fdanny](https://github.com/fdanny))
- Daniel Santana ([@dgsantana](https://github.com/dgsantana))
- David Lechner ([@dlech](https://github.com/dlech))
- Dmitriy Se ([@dmitriyse](https://github.com/dmitriyse))
- He-chien Tsai ([@t3476](https://github.com/t3476))
- Jeff Reback ([@jreback](https://github.com/jreback))
- Joe Frayne ([@jfrayne](https://github.com/jfrayne))
Expand All @@ -29,12 +32,10 @@
- Sean Freitag ([@cowboygneox](https://github.com/cowboygneox))
- Serge Weinstock ([@sweinst](https://github.com/sweinst))
- Virgil Dupras ([@hsoft](https://github.com/hsoft))
- Wenguang Yang ([@yagweb](https://github.com/yagweb))
- Xavier Dupré ([@sdpython](https://github.com/sdpython))
- Zane Purvis ([@zanedp](https://github.com/zanedp))
- ([@ArvidJB](https://github.com/ArvidJB))
- ([@bltribble](https://github.com/bltribble))
- ([@dmitriyse](https://github.com/dmitriyse))
- ([@fdanny](https://github.com/fdanny))
- ([@omnicognate](https://github.com/omnicognate))
- ([@rico-chet](https://github.com/rico-chet))
- ([@rmadsen-ks](https://github.com/rmadsen-ks))
Expand Down
77 changes: 64 additions & 13 deletions 77 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,78 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].

### Added

- Code Coverage (#345)
- Added `pysetargv` (#347)
- Added `Foo` feature

### Changed

- Changed `Bar` feature

### Fixed

- Fixed `FooBar` bug

## [2.3.0][] - 2017-03-11

### Added

- Added Code Coverage (#345)
- Added `PySys_SetArgvEx` (#347)
- Added XML Documentation (#349)
- Added Embedded tests on Appveyor (#353)
- Added PY3 settings to configuration-manager (#346)
- Added `Embedded_Tests` on AppVeyor (#224)(#353)
- Added `Embedded_Tests` on Travis (#224)(#391)
- Added PY3 settings to solution configuration-manager (#346)
- Added `Slack` (#384)(#383)(#386)
- Added function of passing an arbitrary .NET object as the value
of an attribute of `PyObject` (#370)(#373)
- Added `Coverity scan` (#390)
- Added `bumpversion` for version control (#319)(#398)
- Added `tox` for local testing (#345)
- Added `requirements.txt`
- Added to `PythonEngine` methods `Eval` and `Exec` (#389)
- Added implementations of `ICustomMarshal` (#407)
- Added docker images (#322)
- Added hooks in `pyinstaller` and `cx_freeze` for `pythonnet` (#66)

### Changed

- Refactored `setup.py` (#337)
- Upgraded NUnit framework to 2.6.4 (#353)
- Completed refactor of Build Directives on `Runtime.cs` (#339)
- Refactor python unittests (#329)
- Refactored python `unittests` (#329)
- Refactored python `setup.py` (#337)
- Refactored remaining of Build Directives on `runtime.cs` (#339)
- Refactored `Embedded_Tests` to make easier to write tests (#369)
- Changed `unittests` to `pytest` (#368)
- Upgraded NUnit framework from `2.6.3` to `3.5.0` (#341)
- Downgraded NUnit framework from `3.5.0` to `2.6.4` (#353)
- Upgraded NUnit framework from `2.6.4` to `3.6.0` (#371)
- Unfroze Mono version on Travis (#345)
- Changed `conda.recipe` build to only pull-requests (#345)
- Combine `Py_DEBUG` and `PYTHON_WITH_PYDEBUG` flags (#362)

### Deprecated

- Deprecated `RunString` (#401)

### Fixed

- Fixed crash during Initialization (#343)
- Fixed crash during Initialization (#262)(#343)
- Fixed crash during Shutdown (#365)
- Fixed multiple build warnings
- Fixed method signature match for Object Type (#203)(#377)
- Fixed outdated version number in AssemblyInfo (#398)
- Fixed wrong version number in `conda.recipe` (#398)
- Fixed fixture location for Python tests and `Embedded_Tests`
- Fixed `PythonException` crash during Shutdown (#400)
- Fixed `AppDomain` unload during GC (#397)(#400)
- Fixed `Py_Main` & `PySys_SetArgvEx` `no mem error` on `UCS4/PY3` (#399)
- Fixed `Python.Runtime.dll.config` on macOS (#120)
- Fixed crash on `PythonEngine.Version` (#413)
- Fixed `PythonEngine.PythonPath` issues (#179)(#414)(#415)

### Removed

- Removed `six` dependency for unittests (#329)
- Removed `six` dependency for `unittests` (#329)
- Removed `Mono.Unix` dependency for `UCS4` (#360)
- Removed need for `Python.Runtime.dll.config`
- Removed PY32 build option `PYTHON_WITH_WIDE_UNICODE` (#417)

## [2.2.2][] - 2017-01-29

Expand All @@ -41,7 +90,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].

## [2.2.1][] - 2017-01-26

`v2.2.0` had a release issue on pypi. Bumped to `v2.2.1`
- `v2.2.0` had a release issue on PyPi. Bumped to `v2.2.1`

### Added

Expand Down Expand Up @@ -107,7 +156,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].

## [2.0.0][] - 2015-06-26

Release
- Release

## 2.0.0-alpha.2

Expand Down Expand Up @@ -508,7 +557,9 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].

[semantic versioning]: http://semver.org/

[unreleased]: ../../compare/v2.2.2...HEAD
[unreleased]: ../../compare/v2.3.0...HEAD

[2.3.0]: ../../compare/v2.2.2...v2.3.0

[2.2.2]: ../../compare/v2.2.1...v2.2.2

Expand Down
2 changes: 1 addition & 1 deletion 2 LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 the contributors of the "Python for .NET" project
Copyright (c) 2006-2017 the contributors of the "Python for .NET" project

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand Down
20 changes: 0 additions & 20 deletions 20 Python.Runtime.dll.config

This file was deleted.

30 changes: 22 additions & 8 deletions 30 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
[![appveyor shield][]](https://ci.appveyor.com/project/pythonnet/pythonnet/branch/master)
[![travis shield][]](https://travis-ci.org/pythonnet/pythonnet)
[![codecov shield][]](https://codecov.io/github/pythonnet/pythonnet)
[![coverity shield][]](https://scan.coverity.com/projects/pythonnet)

[![license shield][]](./LICENSE)
[![pypi package version][]](https://pypi.python.org/pypi/pythonnet)
[![python supported shield][]](https://pypi.python.org/pypi/pythonnet)
[![stackexchange shield][]](http://stackoverflow.com/questions/tagged/python.net)
[![slack][]](https://pythonnet.slack.com)

Python for .NET is a package that gives Python programmers nearly
seamless integration with the .NET Common Language Runtime (CLR) and
Expand Down Expand Up @@ -35,14 +39,14 @@ from System.Windows.Forms import Form
## Embedding Python in .NET

- All calls to python should be inside
a `using (Py.GIL()) {/_ Your code here _/}` block.
a `using (Py.GIL()) {/* Your code here */}` block.
- Import python modules using `dynamic mod = Py.Import("mod")`,
then you can call functions as normal, eg `mod.func(args)`.
- Use `mod.func(args, Py.kw("keywordargname", keywordargvalue))`
to apply keyword arguments.
- All python objects should be declared as `dynamic` type.
- Mathematical operations involving python and literal/managed types must
have the python object first, eg `np.pi_2` works, `2_np.pi` doesn't.
have the python object first, eg. `np.pi * 2` works, `2 * np.pi` doesn't.

### Example

Expand All @@ -52,17 +56,21 @@ static void Main(string[] args)
using (Py.GIL())
{
dynamic np = Py.Import("numpy");
Console.WriteLine(np.cos(np.pi * 2));

dynamic sin = np.sin;
Console.WriteLine(np.cos(np.pi*2));
Console.WriteLine(sin(5));

double c = np.cos(5) + sin(5);
Console.WriteLine(c);
/* this block is temporarily disabled due to regression

dynamic a = np.array(new List<float> { 1, 2, 3 });
dynamic b = np.array(new List<float> { 6, 5, 4 }, Py.kw("dtype", np.int32));
Console.WriteLine(a.dtype);

dynamic b = np.array(new List<float> { 6, 5, 4 }, Py.kw("dtype", np.int32));
Console.WriteLine(b.dtype);
Console.WriteLine(a * b); */

Console.WriteLine(a * b);
Console.ReadKey();
}
}
Expand All @@ -76,17 +84,23 @@ Output:
-0.6752620892
float64
int32
[6. 10. 12.]
[ 6. 10. 12.]
```

[appveyor shield]: https://img.shields.io/appveyor/ci/pythonnet/pythonnet/master.svg?label=AppVeyor

[codecov shield]: https://img.shields.io/codecov/c/github/pythonnet/pythonnet/master.svg?label=codecov
[codecov shield]: https://img.shields.io/codecov/c/github/pythonnet/pythonnet/master.svg?label=Codecov

[coverity shield]: https://img.shields.io/coverity/scan/7830.svg

[license shield]: https://img.shields.io/badge/license-MIT-blue.svg?maxAge=3600

[pypi package version]: https://img.shields.io/pypi/v/pythonnet.svg

[python supported shield]: https://img.shields.io/pypi/pyversions/pythonnet.svg

[slack]: https://img.shields.io/badge/chat-slack-color.svg?style=social

[stackexchange shield]: https://img.shields.io/badge/StackOverflow-python.net-blue.svg

[travis shield]: https://img.shields.io/travis/pythonnet/pythonnet/master.svg?label=Travis
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.