Skip to content

Commit 4e644eb

Browse files
authored
Remove experimental flag for python (#353)
1 parent b846ce8 commit 4e644eb

File tree

5 files changed

+14
-25
lines changed

5 files changed

+14
-25
lines changed

packages/cli/src/commands/config/add.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function Add(_: IContext): CommandModule<{}, Args> {
3737
.flat(),
3838
}).check(() => {
3939
if (!Project.detectLanguage()) {
40-
throw new Error('Are you in the right folder? Expected a package.json (Typescript) or .sln (C#) file or pyproject.toml (Python, requires ENABLE_EXPERIMENTAL_PYTHON_OPTIONS=true).');
40+
throw new Error('Are you in the right folder? Expected a package.json (Typescript) or .sln (C#) file or pyproject.toml (Python).');
4141
}
4242

4343
return true;

packages/cli/src/commands/new/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,12 @@ export function New(context: IContext): CommandModule<{}, {}> {
1414
return {
1515
command: 'new',
1616
aliases: 'n',
17-
describe: `create a new app project${language ? ` in ${language}` : ''}. You can update language with the "set-lang" command. (Python, requires ENABLE_EXPERIMENTAL_PYTHON_OPTIONS=true).`,
17+
describe: `create a new app project${language ? ` in ${language}` : ''}. You can update language with the "set-lang" command.`,
1818
builder: (b) => {
19-
let builder = b
19+
const builder = b
2020
.command(Typescript(context))
21-
.command(CSharp(context));
22-
// TODO: Remove feature flag for python on public preview
23-
if (process.env.ENABLE_EXPERIMENTAL_PYTHON_OPTIONS === 'true' || process.env.ENABLE_EXPERIMENTAL_PYTHON_OPTIONS === '1') {
24-
builder = builder.command(Python(context));
25-
}
21+
.command(CSharp(context))
22+
.command(Python(context));
2623
return builder
2724
.strict()
2825
.demandCommand(1, 'You must specify a project type');

packages/cli/src/commands/set-lang/index.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,21 @@ import { IContext } from '../../context';
66
import { Settings } from '../../settings';
77

88
const ArgsSchema = z.object({
9-
language: z.string(),
10-
});
9+
language: z.string(),
10+
});
1111

1212
export function SetLang(_: IContext): CommandModule<{}, z.infer<typeof ArgsSchema>> {
1313
const language = Settings.load().language ?? '';
1414
const currentLanguage = language ? `It is currently set to ${language}.` : '';
1515

16-
const pythonEnabled = process.env.ENABLE_EXPERIMENTAL_PYTHON_OPTIONS === 'true' || process.env.ENABLE_EXPERIMENTAL_PYTHON_OPTIONS === '1';
17-
const choices = pythonEnabled
18-
? ['ts', 'cs', 'py', 'typescript', 'csharp', 'python']
19-
: ['ts', 'cs', 'typescript', 'csharp'];
20-
16+
const choices = ['ts', 'cs', 'py', 'typescript', 'csharp', 'python'];
2117
return {
2218
command: 'set-lang <language>',
23-
describe: `set the programming language for the project (typescript, csharp${pythonEnabled ? ', or python' : ''}). ${currentLanguage}`,
19+
describe: `set the programming language for the project (typescript, csharp or python). ${currentLanguage}`,
2420
builder: (b) => {
2521
return b
2622
.positional('language', {
27-
describe: `programming language to use (typescript, csharp${pythonEnabled ? ', or python' : ''})`,
23+
describe: 'programming language to use (typescript, csharp or python)',
2824
type: 'string',
2925
choices,
3026
demandOption: true,
@@ -36,7 +32,7 @@ export function SetLang(_: IContext): CommandModule<{}, z.infer<typeof ArgsSchem
3632
settings.language = 'typescript';
3733
} else if (['cs', 'csharp'].includes(language)) {
3834
settings.language = 'csharp';
39-
} else if (pythonEnabled && ['py', 'python'].includes(language)) {
35+
} else if (['py', 'python'].includes(language)) {
4036
settings.language = 'python';
4137
}
4238

packages/cli/src/project/project.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ export class Project implements IProject {
5050
return 'csharp';
5151
}
5252
if (
53-
fs.existsSync(path.join(process.cwd(), 'pyproject.toml')) &&
54-
(process.env.ENABLE_EXPERIMENTAL_PYTHON_OPTIONS === 'true' ||
55-
process.env.ENABLE_EXPERIMENTAL_PYTHON_OPTIONS === '1')
53+
fs.existsSync(path.join(process.cwd(), 'pyproject.toml'))
5654
) {
5755
return 'python';
5856
}
@@ -67,7 +65,7 @@ export class Project implements IProject {
6765
const language = this.detectLanguage();
6866

6967
if (!language) {
70-
throw new Error('Are you in the right folder? Expected a package.json (Typescript), .sln (C#), or pyproject.toml (Python, requires ENABLE_EXPERIMENTAL_PYTHON_OPTIONS=true).');
68+
throw new Error('Are you in the right folder? Expected a package.json (Typescript), .sln (C#), or pyproject.toml (Python).');
7169
}
7270

7371
return new ProjectBuilder()

packages/cli/src/settings.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import { z } from 'zod';
66

77
import { ProjectLanguage } from './project/project';
88

9-
const languageEnum = process.env.ENABLE_EXPERIMENTAL_PYTHON_OPTIONS === 'true' || process.env.ENABLE_EXPERIMENTAL_PYTHON_OPTIONS === '1'
10-
? z.enum(['typescript', 'csharp', 'python'])
11-
: z.enum(['typescript', 'csharp']);
9+
const languageEnum = z.enum(['typescript', 'csharp', 'python']);
1210

1311
const Schema = z.object({
1412
env: z.string(),

0 commit comments

Comments
 (0)