Skip to content
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

Code Quality: Refactor code and make it more modern #1815

Open
wants to merge 87 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
616b49e
Code cleanup
Lamparter Nov 17, 2024
184bb15
Remove unnecessary `Directory.Build.props` file
Lamparter Nov 17, 2024
6997cf5
Refactor analyzer project
Lamparter Nov 17, 2024
1892629
Rename projects
Lamparter Nov 17, 2024
dd91b5d
Add back "unnecessary" `Directory.Build.props` file
Lamparter Nov 17, 2024
2fa45f0
Merge branch 'main' into refactor
Lamparter Nov 17, 2024
fb3c09f
Update `Src/README.md`
Lamparter Nov 17, 2024
717b16c
Fix NuGet inconsistencies and modernize structure
Lamparter Nov 17, 2024
6698292
Update `Src/README.md`
Lamparter Nov 17, 2024
a2c85dc
Removed submodule Src/DLR
Lamparter Nov 17, 2024
7e38e2d
Simplify root directory
Lamparter Nov 17, 2024
18dd588
Removed submodule DLR
Lamparter Nov 25, 2024
e7e538c
Revert "Simplify root directory"
Lamparter Nov 25, 2024
d851d71
Add DLR submodule
Lamparter Nov 25, 2024
a428c0d
Rename directories
Lamparter Nov 25, 2024
571f43a
Rename `GetRenamed` directories
Lamparter Nov 25, 2024
9930af4
Change capitalization in `.gitmodules`
Lamparter Nov 25, 2024
dda6915
Initialize submodule
Lamparter Nov 25, 2024
16bdc18
Sort internal directories
Lamparter Nov 25, 2024
20fb46c
Rename `DLR` to `runtime` to match structure of .NET Runtime
Lamparter Nov 25, 2024
6eb0a2a
Remove DLR submodule
Lamparter Nov 25, 2024
679d995
Initialize DLR submodule
Lamparter Nov 25, 2024
d263059
Add documentation for `src` directory
Lamparter Nov 25, 2024
488758d
Document Roslyn analyzer directory
Lamparter Nov 25, 2024
cb61876
Document extensions directory
Lamparter Nov 25, 2024
90804c9
Document console directory
Lamparter Nov 25, 2024
dcd1827
Document IronPython directory
Lamparter Nov 25, 2024
966b0b2
Update `src/README.md`
Lamparter Nov 25, 2024
3d18b15
Document build directory
Lamparter Nov 25, 2024
d7fd8b0
Document tests directory
Lamparter Nov 25, 2024
a1e6005
Remove full-stop character from Roslyn analyzer documentation
Lamparter Nov 25, 2024
0829c77
Fix project references in solution
Lamparter Nov 25, 2024
573b14c
Remove deleted ruleset file from solution
Lamparter Nov 25, 2024
1b9e47a
Make solution prettier
Lamparter Nov 25, 2024
6340581
Fix all project references
Lamparter Nov 25, 2024
8d48c8e
Fix PowerShell script
Lamparter Nov 25, 2024
af7e86b
Fix final references
Lamparter Nov 25, 2024
10a679e
Fix internal assembly component reference errors
Lamparter Nov 25, 2024
99a35c7
Remove internal declaration on built-in module test method
Lamparter Nov 25, 2024
a562f61
Replace more `internal` statements with `public` ones
Lamparter Nov 25, 2024
5c5c1ef
Code mess-up
Lamparter Nov 26, 2024
f3662cb
Merge branch `main` into `refactor`
Lamparter Nov 26, 2024
3a11995
Initial rename of core folder
Lamparter Nov 26, 2024
f1a0718
Fix project references due to core folder rename
Lamparter Nov 26, 2024
717d826
Move CTypes to tests directory
Lamparter Nov 26, 2024
fc68d5a
Rename CTypes test
Lamparter Nov 26, 2024
d4ea59c
Retarget CTypes project to latest platform toolset
Lamparter Nov 26, 2024
928006e
Rename CTypes project
Lamparter Nov 26, 2024
976ad6e
Initial rename of platforms folder
Lamparter Nov 26, 2024
de79b5d
Fix project reference in solution
Lamparter Nov 26, 2024
d2ad1fc
Rename solution folders
Lamparter Nov 26, 2024
1b307a0
Move compiler project
Lamparter Nov 26, 2024
2094fb5
Fix project references
Lamparter Nov 26, 2024
2dbfd7b
Remove CTypes project from solution
Lamparter Nov 26, 2024
3a2e84a
Fix references to documentation
Lamparter Nov 26, 2024
7aa1e90
Simplify compiler project name
Lamparter Nov 26, 2024
571ed1a
Move compiler project in solution context
Lamparter Nov 26, 2024
119eae3
Mark more classes and constructors as public
Lamparter Nov 26, 2024
31e7105
Add `!NETFRAMEWORK` compiler statement to test method
Lamparter Nov 26, 2024
6f2f009
More public declarations
Lamparter Nov 26, 2024
e632016
Merge branch `main` into `refactor`
Lamparter Nov 27, 2024
27b6160
Fix `InternalsVisibleToAttribute`
Lamparter Nov 27, 2024
3370273
Less public declarations
Lamparter Nov 27, 2024
32ac9c9
Remove `!NETFRAMEWORK` compiler statement from test method
Lamparter Nov 27, 2024
da4f72a
Mark less classes and constructors as public
Lamparter Nov 27, 2024
a87f9af
Replace more `public` statements with `internal` ones
Lamparter Nov 27, 2024
11d5dc4
Add internal declaration to built-in module test method
Lamparter Nov 27, 2024
57ebcae
Undo fix to assembly component reference errors
Lamparter Nov 27, 2024
84321ca
Move `utils` to `eng`
Lamparter Nov 27, 2024
3790dd4
Update reference to build directory in choco targets
Lamparter Nov 27, 2024
ef14b6e
Fix ignores
Lamparter Nov 27, 2024
d20ca2c
Move scripts directory
Lamparter Nov 27, 2024
d875546
Fix directory references in packaging targets
Lamparter Nov 27, 2024
a18b76e
Fix references in ignore
Lamparter Nov 27, 2024
8e37d84
Move scripts folder
Lamparter Nov 27, 2024
86369be
Move standard library
Lamparter Nov 28, 2024
5e1d065
Merge branch `main` into `refactor`
Lamparter Nov 28, 2024
99a5101
Update copyright
Lamparter Nov 28, 2024
cd928ec
Fix references to standard library
Lamparter Nov 28, 2024
dc95e6d
Fix all other references to structure
Lamparter Nov 28, 2024
f915c58
Update references to artifacts directory
Lamparter Nov 29, 2024
c9ea6d0
Update submodule
Lamparter Nov 29, 2024
dc16601
Merge branch `main` into `refactor`
Lamparter Nov 29, 2024
512976c
Attempt to fix tests directory references
Lamparter Nov 29, 2024
e3d47bd
Fix typo in directory name
Lamparter Nov 29, 2024
9212066
Fix tests
Lamparter Nov 29, 2024
f72cdc3
Prune ignore
Lamparter Nov 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.os }}
path: Package/Release/Packages
path: eng/Release/Packages
- name: Test (net462)
run: ./make.ps1 -frameworks net462 test-all
shell: pwsh
Expand Down
206 changes: 192 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# Visual Studio
.vs/
.vscode/
## This file is used to ignore files and directories when using IronPython with Git.
## It is based on the VisualStudio.gitignore file from the GitHub gitignore repository,
## as well as the legacy .gitignore file from the IronPython repository on CodePlex.
##
## For more information, visit: https://docs.github.com/en/github/using-git/ignoring-files

# Temporary VS files
*.suo
*.csproj.user
launchSettings.json

# Build results
obj/
bin/
Package/Release/
*.binlog
eng/Release/

# NuGet Packages
packages/
Expand All @@ -20,9 +17,190 @@ packages/
__pycache__/

# Generated files
Src/IronPythonTest/TestResults/
Src/IronPythonTest/runsettings.*.xml
tests/ironpython/TestResults/
tests/ironpython/runsettings.*.xml

# Created by CPython tests
src/core/IronPython.StdLib/Lib/lib2to3/Grammar*.pickle
src/core/IronPython.StdLib/Lib/lib2to3/PatternGrammar*.pickle

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates

# Mono auto generated files
mono_crash.*

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/

# Visual Studio 2015/2017 cache/options directory
.vs/

# Visual Studio 2017 auto generated files
Generated\ Files/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml

# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
# but not Directory.Build.rsp, as it configures directory-level build defaults
!Directory.Build.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# DotCover is a Code Coverage Tool
*.dotCover

# Visual Studio code coverage results
*.coverage
*.coveragexml

# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

# MSBuild Binary and Structured Log
*.binlog

# Local History for Visual Studio
.localhistory/

# Visual Studio History (VSHistory) files
.vshistory/

# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# created by CPython tests
Src/StdLib/Lib/lib2to3/Grammar*.pickle
Src/StdLib/Lib/lib2to3/PatternGrammar*.pickle
# JetBrains Rider
*.sln.iml
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "Src/DLR"]
path = Src/DLR
[submodule "src/runtime"]
path = src/runtime
url = https://github.com/IronLanguages/dlr
branch = main
14 changes: 7 additions & 7 deletions Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

<RootDir>$(MSBuildThisFileDirectory)</RootDir>
<Solution>$(RootDir)IronPython.sln</Solution>
<UtilDir>$(RootDir)Util</UtilDir>
<ReferenceDir>$(RootDir)Util\References</ReferenceDir>
<UtilDir>$(RootDir)eng\utils</UtilDir>
<ReferenceDir>$(RootDir)eng\utils\References</ReferenceDir>
<BinDir>$(RootDir)bin</BinDir>
<BuildSysDir>$(RootDir)Build</BuildSysDir>
<BuildSysDir>$(RootDir)eng</BuildSysDir>
</PropertyGroup>

<Import Project="$(BuildSysDir)\Tasks.Targets" />
Expand All @@ -21,8 +21,8 @@
<PropertyGroup>
<PackageVersion Condition="'$(ReleaseLevel)' == 'final'">$(MajorVersion).$(MinorVersion).$(MicroVersion)</PackageVersion>
<PackageVersion Condition="'$(ReleaseLevel)' != 'final' or '$(ReleaseSerial)' != '0'">$(MajorVersion).$(MinorVersion).$(MicroVersion)-$(ReleaseLevel)$(ReleaseSerial)</PackageVersion>
<StageDir>$(RootDir)Package\$(Configuration)\Stage\IronPython-$(PackageVersion)</StageDir>
<PackageDir>$(RootDir)Package\$(Configuration)\Packages\IronPython-$(PackageVersion)</PackageDir>
<StageDir>$(RootDir)eng\$(Configuration)\Stage\IronPython-$(PackageVersion)</StageDir>
<PackageDir>$(RootDir)eng\$(Configuration)\Packages\IronPython-$(PackageVersion)</PackageDir>
<StdLibDirName>lib</StdLibDirName>
</PropertyGroup>

Expand Down Expand Up @@ -117,7 +117,7 @@
</Target>

<Target Name="_CopyStdLib" DependsOnTargets="_MakeStageDir">
<MSBuild Projects="$(RootDir)\Src\StdLib\StdLib.pyproj"
<MSBuild Projects="$(RootDir)\src\core\IronPython.StdLib\IronPython.StdLib.pyproj"
Properties="OutputPath=$(StageDir);StdLibDirName=$(StdLibDirName)"
Targets="Stage" />
</Target>
Expand All @@ -138,5 +138,5 @@
<!-- This looks like an empty target, but the targets files use it as an AfterTargets -->
<Target Name="Package" DependsOnTargets="Stage" />

<Import Project="$(RootDir)\Package\**\*.Packaging.targets" />
<Import Project="$(RootDir)\eng\**\*.Packaging.targets" />
</Project>
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

The steps to contribute a change are:

1. Fork the IronPython3 repository. For more information see [Getting the Sources](Documentation/getting-the-sources.md).
2. Build the repository. For more information see [Building](Documentation/building.md).
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](Documentation/modifying-the-sources.md).
1. Fork the IronPython3 repository. For more information see [Getting the Sources](docs/getting-the-sources.md).
2. Build the repository. For more information see [Building](docs/building.md).
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).
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).
1. Create a pull request on Github, this will initiate a code review and CLA signing request
1. The IronPython team will review, and possibly request changes, to your PR
Expand Down
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<PropertyGroup>
<!-- These are normally set by Build.proj, except when building from VS. -->
<RootDir Condition=" '$(RootDir)' == '' ">$(MSBuildThisFileDirectory)</RootDir>
<BuildSysDir Condition=" '$(BuildSysDir)' == '' ">$(RootDir)Build</BuildSysDir>
<ReferenceDir Condition=" '$(ReferenceDir)' == '' ">$(RootDir)Util\References</ReferenceDir>
<BuildSysDir Condition=" '$(BuildSysDir)' == '' ">$(RootDir)eng</BuildSysDir>
<ReferenceDir Condition=" '$(ReferenceDir)' == '' ">$(RootDir)eng\utils\References</ReferenceDir>

<Mono Condition=" '$(Mono)' == '' AND '$(MSBuildRuntimeType)' == 'Mono' ">true</Mono>

<!-- The following two lines prevent csc.rsp and Microsoft.NETFramework.props from adding
additional assembly references. -->
<NoConfig>true</NoConfig>
Expand Down
Loading
Loading