-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add version info to user-agent header (#357)
- Loading branch information
Showing
12 changed files
with
77 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { readFileSync, writeFileSync } from 'fs'; | ||
import process from 'process'; | ||
const packageJson = JSON.parse(readFileSync('package.json')); | ||
|
||
let newVersion; | ||
if (process.argv.length > 2) { | ||
newVersion = process.argv[2]; | ||
} else { | ||
const versionParts = packageJson.version.split('.'); | ||
versionParts[2] = parseInt(versionParts[2]) + 1; | ||
newVersion = versionParts.join('.'); | ||
} | ||
console.log(`Bumping version to ${newVersion}`); | ||
|
||
packageJson.version = newVersion; | ||
writeFileSync('package.json', JSON.stringify(packageJson, null, 2)); | ||
|
||
const indexFilePath = 'src/index.ts'; | ||
let indexFileContent = readFileSync(indexFilePath, 'utf-8'); | ||
indexFileContent = indexFileContent.replace(/export const __version__ = "[0-9]+\.[0-9]+\.[0-9]+";/g, `export const __version__ = "${newVersion}";`); | ||
writeFileSync(indexFilePath, indexFileContent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { readFileSync } from "fs"; | ||
import { join } from "path"; | ||
const indexFilePath = "src/index.ts"; | ||
const packageJson = JSON.parse(readFileSync("package.json")); | ||
let indexFileContent = readFileSync(indexFilePath, "utf-8"); | ||
|
||
const packageVersion = packageJson.version; | ||
const indexVersion = indexFileContent.match( | ||
/__version__\s*=\s*['"]([^'"]+)['"]/ | ||
)[1]; | ||
|
||
if (packageVersion !== indexVersion) { | ||
throw new Error( | ||
`Version mismatch! package.json version: ${packageVersion}, index.ts version: ${indexVersion}` | ||
); | ||
} | ||
console.log(`Version check passed: ${packageVersion} === ${indexVersion}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "langsmith" | ||
version = "0.0.80" | ||
version = "0.0.81" | ||
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." | ||
authors = ["LangChain <[email protected]>"] | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters