Skip to content

Commit 6c5aa97

Browse files
committed
Merge branch 'main' into 3.6
2 parents 449f8b5 + 33a8b15 commit 6c5aa97

File tree

271 files changed

+6264
-3874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+6264
-3874
lines changed

.gitattributes

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@ tests/suite/file_without_BOM.txt -text
4545
# Do not normalize on commit.
4646
*.pdf -text
4747

48-
*.pck linguist-detectable=false
49-
*.html linguist-documentation=true
48+
# Hide certain languages from GitHub Linguist
49+
* linguist-detectable=false
50+
*.cs linguist-detectable
51+
*.py linguist-detectable
52+
src/core/IronPython.StdLib/lib/** linguist-vendored

.github/workflows/main.yml

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,23 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7-
87
runs-on: ${{ matrix.os }}
98

109
strategy:
1110
fail-fast: false
1211
matrix:
13-
os: [windows-latest, ubuntu-22.04, macos-latest-large]
12+
os: [windows-latest, ubuntu-22.04, macos-latest]
1413

1514
steps:
15+
# Prerequisites
1616
- name: Install tools
1717
if: matrix.os == 'ubuntu-22.04'
1818
run: sudo apt-get -yq install mono-vbnc dos2unix
1919
- uses: actions/checkout@v4
2020
with:
2121
submodules: true
22+
23+
# Setup .NET
2224
- name: Setup .NET 6.0
2325
uses: actions/setup-dotnet@v4
2426
with:
@@ -31,26 +33,59 @@ jobs:
3133
uses: actions/setup-dotnet@v4
3234
with:
3335
dotnet-version: '9.0.x'
36+
37+
# CI debug information
3438
- name: Version Information
3539
run: |
3640
dotnet --info
3741
try { msbuild -version } catch { }
3842
try { mono --version } catch { }
3943
shell: pwsh
44+
45+
# Build & package
4046
- name: Build
4147
run: pwsh make.ps1
4248
- name: Package
4349
run: pwsh make.ps1 package
50+
51+
# Upload package
4452
- uses: actions/upload-artifact@v4
4553
with:
4654
name: packages-${{ matrix.os }}
4755
path: Package/Release/Packages
48-
- name: Test (net462)
49-
run: ./make.ps1 -frameworks net462 test-all
50-
shell: pwsh
51-
- name: Test (net6.0)
52-
run: ./make.ps1 -frameworks net6.0 test-all
53-
shell: pwsh
54-
- name: Test (net8.0)
55-
run: ./make.ps1 -frameworks net8.0 test-all
56+
57+
test:
58+
runs-on: ${{ matrix.os }}
59+
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
os: [windows-latest, ubuntu-22.04, macos-latest]
64+
framework: ['net462', 'net6.0', 'net8.0']
65+
66+
steps:
67+
# Prerequisites
68+
- uses: actions/checkout@v4
69+
with:
70+
submodules: true
71+
72+
# Setup .NET
73+
- name: Setup .NET 6.0
74+
uses: actions/setup-dotnet@v4
75+
with:
76+
dotnet-version: '6.0.x'
77+
- name: Setup .NET 8.0
78+
uses: actions/setup-dotnet@v4
79+
with:
80+
dotnet-version: '8.0.x'
81+
- name: Setup .NET 9.0
82+
uses: actions/setup-dotnet@v4
83+
with:
84+
dotnet-version: '9.0.x'
85+
86+
# Build & Test
87+
- name: Build
88+
run: pwsh make.ps1
89+
- name: Test (${{ matrix.framework }})
90+
run: ./make.ps1 -frameworks ${{ matrix.framework }} test-all
5691
shell: pwsh

.vsts-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
displayName: Linux (Ubuntu)
1919
timeoutInMinutes: 180
2020
pool:
21-
vmImage: ubuntu-latest
21+
vmImage: ubuntu-22.04
2222
steps:
2323
- template: eng/steps.yml
2424
parameters:

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
The steps to contribute a change are:
44

5-
1. Fork the IronPython3 repository. For more information see [Getting the Sources](docs/getting-the-sources.md).
6-
2. Build the repository. For more information see [Building](docs/building.md).
7-
1. Make your changes on your machine, ensure ```make.ps1 test-all``` runs successfully, and commit your changes. For more information see [Modifying the Sources](docs/modifying-the-sources.md).
8-
1. Push the commits to your fork. This way your name will be the author of the commit in the main IronPython3 tree (once the commits are pulled into the main tree).
9-
1. Create a pull request on Github, this will initiate a code review and CLA signing request
10-
1. The IronPython team will review, and possibly request changes, to your PR
11-
1. Once all comments/questions/concerns have been addressed, your PR will be merged.
5+
1. Fork the IronPython3 repository. For more information see [Getting the Sources](https://github.com/IronLanguages/ironpython3/wiki/Getting-the-sources).
6+
2. Build the repository. For more information see [Building](https://github.com/IronLanguages/ironpython3/wiki/Building).
7+
3. Make your changes on your machine, ensure ```make.ps1 test-all``` runs successfully, and commit your changes. For more information see [Modifying the Sources](https://github.com/IronLanguages/ironpython3/wiki/Modifying-the-sources).
8+
4. Push the commits to your fork. This way your name will be the author of the commit in the main IronPython3 tree (once the commits are pulled into the main tree).
9+
5. Create a pull request on Github, this will initiate a code review and CLA signing request
10+
6. The IronPython team will review, and possibly request changes, to your PR
11+
7. Once all comments/questions/concerns have been addressed, your PR will be merged.
1212

1313
Also, [Collaborative Github Workflow](http://www.eqqon.com/index.php/Collaborative_Github_Workflow) has a very good description of the workflow and tips and tricks when contributing to a project hosted on GitHub.
1414

README.md

Lines changed: 72 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ IronPython 3 targets Python 3, including the re-organized standard library, Unic
1212
| **What?** | **Where?** |
1313
| --------: | :------------: |
1414
| **Windows/Linux/macOS Builds** | [![Build status](https://dotnet.visualstudio.com/IronLanguages/_apis/build/status/ironpython3)](https://dotnet.visualstudio.com/IronLanguages/_build/latest?definitionId=43) [![Github build status](https://github.com/IronLanguages/ironpython3/workflows/CI/badge.svg)](https://github.com/IronLanguages/ironpython3/actions?workflow=CI) |
15-
| **Downloads** | [![NuGet](https://img.shields.io/nuget/vpre/IronPython.svg)](https://www.nuget.org/packages/IronPython/3.4.0) [![Release](https://img.shields.io/github/release/IronLanguages/ironpython3.svg?include_prereleases)](https://github.com/IronLanguages/ironpython3/releases/latest)|
15+
| **Downloads** | [![NuGet](https://img.shields.io/nuget/vpre/IronPython.svg)](https://www.nuget.org/packages/IronPython/latest) [![Release](https://img.shields.io/github/release/IronLanguages/ironpython3.svg?include_prereleases)](https://github.com/IronLanguages/ironpython3/releases/latest)|
1616
| **Help** | [![Gitter chat](https://badges.gitter.im/IronLanguages/ironpython.svg)](https://gitter.im/IronLanguages/ironpython) [![StackExchange](https://img.shields.io/badge/stack%20overflow-ironpython-informational?logo=stack-overflow&logoColor=white)](https://stackoverflow.com/questions/tagged/ironpython) |
1717

1818

1919
## Examples
2020

21+
To see how to use in PowerShell (either directly embedded or executable invocation), skip to [Installation](#Installation)
22+
2123
The following C# program:
2224

2325
```cs
@@ -51,10 +53,12 @@ System.Console.WriteLine(greetings("world"));
5153
This example assumes that `IronPython` has been added to the C# project as a NuGet package.
5254

5355
## Code of Conduct
56+
5457
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
5558
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
5659

5760
## State of the Project
61+
5862
The current target is Python 3.4, although features and behaviors from later versions may be included.
5963

6064
See the following lists for features from each version of CPython that have been implemented:
@@ -68,22 +72,84 @@ See the following lists for features from each version of CPython that have been
6872
- [What's New In Python 3.6](WhatsNewInPython36.md)
6973

7074
## Contributing
75+
7176
For details on contributing see the [Contributing](CONTRIBUTING.md) article.
7277

7378
## Upgrading from IronPython 2
74-
For details on upgrading from IronPython 2 to 3 see the [Upgrading from IronPython 2 to 3](docs/upgrading-from-ipy2.md) article.
79+
80+
For details on upgrading from IronPython 2 to 3 see the [Upgrading from IronPython 2 to 3](https://github.com/IronLanguages/ironpython3/wiki/Upgrading-from-IronPython2) article.
7581

7682
## Differences with CPython
77-
While compatibility with CPython is one of our main goals with IronPython 3, there are still some differences that may cause issues. See [Differences from CPython](docs/differences-from-c-python.md) for details.
83+
84+
While compatibility with CPython is one of our main goals with IronPython 3, there are still some differences that may cause issues. See [Differences from CPython](https://github.com/IronLanguages/ironpython3/wiki/Differences-from-CPython) for details.
7885

7986
## Package compatibility
80-
See the [Package compatibility](docs/package-compatibility.md) document for information on compatibility with popular packages.
87+
88+
See the [Package compatibility](https://github.com/IronLanguages/ironpython3/wiki/Package-compatibility) document for information on compatibility with popular packages.
8189

8290
## Installation
83-
Binaries of IronPython 3 can be downloaded from the [release page](https://github.com/IronLanguages/ironpython3/releases/latest), available in various formats: `.msi`, `.zip`, `.deb`, `.pkg`. The IronPython package is also available on [NuGet](https://www.nuget.org/packages/IronPython/3.4.0). See the [installation document](docs/installing.md) for detailed instructions on how to install a standalone IronPython interpreter on various operating systems and .NET frameworks.
91+
92+
Binaries of IronPython 3 can be downloaded from the [release page](https://github.com/IronLanguages/ironpython3/releases/latest), available in various formats: `.msi`, `.zip`, `.deb`, `.pkg`. The IronPython package is also available on [NuGet](https://www.nuget.org/packages/IronPython/latest). See the [installation document](https://github.com/IronLanguages/ironpython3/wiki/Installing) for detailed instructions on how to install a standalone IronPython interpreter on various operating systems and .NET frameworks.
93+
94+
### PowerShell
95+
96+
For usage in PowerShell, you can install using the Install-IronPython.ps1 within the aforementioned `.zip` file or by simply using this one-liner:
97+
98+
```pwsh
99+
& ([scriptblock]::Create((iwr `
100+
-Uri 'https://raw.githubusercontent.com/IronLanguages/ironpython3/main/eng/scripts/Install-IronPython.ps1').Content)) `
101+
-Path "~/ipyenv/v3.4.2"
102+
103+
# Optionally, ensure pip:
104+
# & "~/ipyenv/v3.4.2/ipy" -m ensurepip
105+
```
106+
107+
Once installed, you can start using IronPython directly in PowerShell!
108+
109+
To use the ipy shim, you can use:
110+
```pwsh
111+
& "~/ipyenv/v3.4.2/Enter-IronPythonEnvironment.ps1"
112+
113+
ipy -c "print('Hello from IronPython!')"
114+
```
115+
116+
... or to use IronPython embedded in PowerShell, you can use:
117+
```pwsh
118+
Import-Module "~/ipyenv/v3.4.2/IronPython.dll"
119+
120+
$engine = & {
121+
$engine = [IronPython.Hosting.Python]::CreateEngine()
122+
123+
# You need to add the correct paths, as IronPython will use PowerShell's installation path by default
124+
$paths = $engine.GetSearchPaths()
125+
$paths.Add("$(Resolve-Path "~/ipyenv/v3.4.2/lib")")
126+
$paths.Add("$(Resolve-Path "~/ipyenv/v3.4.2/lib/site-packages")")
127+
128+
# To use `wpf` and `sqlite3` you have to add the DLLs search path
129+
# - the [IronPython.SQLite] and [IronPython.WPF] powershell namespaces will become available on python import
130+
$paths.Add("$(Resolve-Path "~/ipyenv/v3.4.2/DLLs")")
131+
132+
# or if you prefer to have the powershell namespaces early, you can use:
133+
# - just note, you will have to initialize _sqlite3 (see further down the script)
134+
# Import-Module "~/ipyenv/v3.4.2/DLLs/IronPython.SQLite.dll"
135+
# Import-Module "~/ipyenv/v3.4.2/DLLs/IronPython.WPF.dll"
136+
137+
$engine.SetSearchPaths($paths)
138+
139+
# Then have fun!
140+
$engine.Execute("print('Hello from IronPython!')")
141+
142+
# Optionally, if you need to initialize _sqlite3:
143+
# $engine.Execute("import sqlite3")
144+
145+
return $engine
146+
}
147+
```
84148

85149
## Build
86-
See the [building document](docs/building.md). Since the main development is on Windows, bugs on other platforms may inadvertently be introduced - please report them!
150+
151+
See the [building document](https://github.com/IronLanguages/ironpython3/wiki/Building). Since the main development is on Windows, bugs on other platforms may inadvertently be introduced - please report them!
87152

88153
## Supported Platforms
154+
89155
IronPython 3 targets .NET Framework 4.6.2, .NET Standard 2.0, .NET 6.0 and .NET 8.0. The support for .NET and .NET Core follow the lifecycle defined on [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core).

docs/building.md

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1 @@
1-
# Building IronPython3
2-
3-
To build IronPython3 you will need the [.NET SDK (minimum v6.0.100)](https://dotnet.microsoft.com/download/visual-studio-sdks).
4-
5-
See [Getting the Sources](getting-the-sources.md) for information on getting the source for IronPython3.
6-
7-
## Building from Visual Studio
8-
9-
Visual Studio 2022 v17.0 or above is required to build IronPython3.
10-
11-
* Open the `IronPython.sln` solution file
12-
* Select the configuration options (Release, Debug, etc.)
13-
* Press Ctrl+Shift+B or F6 to build the solution
14-
15-
## Building from the command line
16-
17-
IronPython3 uses PowerShell to run the build and testing from the command line. You can either use a PowerShell directly, or prefix the commands below with `powershell` on Windows, or `pwsh` on Linux/macOS.
18-
19-
On Linux/macOS you will need to install [PowerShell](https://github.com/PowerShell/PowerShell/releases)
20-
21-
Change the working directory to the path where you cloned the sources and run `./make.ps1`
22-
23-
By default, with no options, `make.ps1` will build the `Release` mode binaries. If you would like to build `Debug` binaries, you can run `./make.ps1 debug`
24-
25-
Other options available for `make.ps1` are
26-
27-
```
28-
-configuration (debug/release) The configuration to build for
29-
-platform (x86/x64) The platform to use in running tests
30-
-runIgnored Run tests that are marked as ignored in the .ini manifests
31-
-frameworks A comma separated list of frameworks to run tests for
32-
(use nomenclature as is used in msbuild files for TargetFrameworks)
33-
```
34-
35-
There are also other targets available for use with packaging and testing, most come in debug and release (default) versions, such as `package-debug` and `package`
36-
37-
```
38-
package Creates packages supported by the current platform
39-
stage Stages files ready for packaging
40-
test-* Runs tests from `all` categories, `ironpython` specific tests,
41-
`cpython` tests from the CPython stdlib test suite
42-
```
43-
44-
If the build is successful the binaries are stored in `ironpython3/bin/{Configuration}/{TargetFramework}`.
45-
46-
## Running
47-
48-
The standard library is not copied over to the `bin` folder during the build process, it lives in `src/core/IronPython.StdLib/lib`.
49-
- When running the `Release` configuration executable, you should set the environment variable `IRONPYTHONPATH` to this folder.
50-
- When running the `Debug` configuration executable, this folder is automatically added to `sys.path`.
1+
This document has been moved to the IronPython wiki: [Building](https://github.com/IronLanguages/ironpython3/wiki/Building)

0 commit comments

Comments
 (0)