Skip to content

Commit

Permalink
tests: add tests and GHA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shepherdjerred committed Oct 24, 2023
1 parent 1c41524 commit 369d9d0
Show file tree
Hide file tree
Showing 16 changed files with 261 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.snapshots/ linguist-generated=true
testdata/ linguist-generated=true
38 changes: 38 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: install go
uses: actions/setup-go@v4
with:
go-version: 'stable'
- name: install python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: install python dependencies
run: pip install twine build
- name: install go dependencies
run: go install gotest.tools/gotestsum@latest
- name: run golangci-lint
uses: reviewdog/action-golangci-lint@v2
- name: build
run: go build
- name: test
run: gotestsum --jsonfile unit-tests.json
- name: annotate tests
if: always()
uses: guyarb/[email protected]
with:
test-results: unit-tests.json
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testdata/packages/
!testdata/packages/.gitkeep
.idea
*.iml
1 change: 1 addition & 0 deletions archiver/archive_reader_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package archiver_test
1 change: 1 addition & 0 deletions distributions/distribution_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package distributions_test
1 change: 1 addition & 0 deletions distributions/metadata_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package distributions_test
1 change: 1 addition & 0 deletions distributions/sdist_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package distributions_test
1 change: 1 addition & 0 deletions distributions/wheel_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package distributions_test
11 changes: 10 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@ require (
golang.org/x/text v0.13.0
)

require golang.org/x/sys v0.12.0 // indirect
require (
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/testify v1.8.4 // indirect
golang.org/x/sys v0.12.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
21 changes: 21 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible h1:UafIjBvWQmS9i/xRg+CamMrnLTKNzo+bdmT/oH34c2Y=
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible/go.mod h1:Au1Xw1sgaJ5iSFktEhYsS0dbQiS1B0/XMXl+42y9Ilk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
1 change: 1 addition & 0 deletions packages/hash_manager_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package packages_test
1 change: 1 addition & 0 deletions packages/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package packages_test
1 change: 1 addition & 0 deletions packages/utils_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package packages_test
2 changes: 1 addition & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func findDistributions(dists []string) ([]string, error) {
if err != nil {
return nil, err
}
if files == nil || len(files) == 0 {
if len(files) == 0 {
return nil, fmt.Errorf("cannot find file (or expand pattern): %s", filename)
}

Expand Down
177 changes: 177 additions & 0 deletions parse_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
package parse_test

import (
"fmt"
"github.com/google/go-cmp/cmp"
"github.com/rstudio/python-distribution-parser"
"github.com/stretchr/testify/assert"
"log"
"net/http"
"net/http/httptest"
"net/url"
"path"

"os"
"os/exec"
"path/filepath"
"testing"
)

var twine = "twine"
var testdata = "testdata/packages/"
var repositoryUrls = []string{
"https://github.com/ActiveState/appdirs",
"https://github.com/pallets/click",
"https://github.com/python/importlib_metadata",
"https://github.com/matplotlib/matplotlib",
"https://github.com/sdispater/pendulum",
"https://github.com/pytest-dev/pytest",
}

// toRepositoryName converts a repository name to the name of the folder the repository will be cloned in
// for example, https://github.com/ActiveState/appdirs => appdirs
func toRepositoryName(repositoryUrl string) (string, error) {
result, err := url.Parse(repositoryUrl)
if err != nil {
return "", err
}
return path.Base(result.Path), nil
}

func getRepositoryPath(repository string) string {
return fmt.Sprintf("%s%s/", testdata, repository)
}

func getDistributionPath(repository string) string {
return fmt.Sprintf("%sdist/", getRepositoryPath(repository))
}

func getTarballPath(repository string) (string, error) {
distributionPath := getDistributionPath(repository)
files, err := os.ReadDir(distributionPath)
if err != nil {
log.Fatal(err)
}

var tarballs []string

for _, file := range files {
if filepath.Ext(file.Name()) == ".gz" {
tarballs = append(tarballs, file.Name())
}
}

if len(tarballs) != 1 {
return "", fmt.Errorf("unexpected number of .gz files in %s: %d", distributionPath, len(tarballs))
}
return fmt.Sprintf("%s%s", distributionPath, tarballs[0]), nil
}

func clone(repositoryUrl string) error {
repositoryName, err := toRepositoryName(repositoryUrl)
if err != nil {
return err
}

_, err = os.Stat(getRepositoryPath(repositoryName))
if os.IsNotExist(err) {
cmd := exec.Command("git", "clone", repositoryUrl)
cmd.Dir = testdata
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
return err
} else {
log.Printf("%s is already cloned", repositoryName)
return nil
}
}

func buildDistribution(repository string) error {
_, err := os.Stat(getDistributionPath(repository))
if os.IsNotExist(err) {
cmd := exec.Command("python", "-m", "build")
cmd.Dir = getRepositoryPath(repository)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
return err
} else {
log.Printf("%s is already built", repository)
return nil
}

}

func getTwineMetadata(repository string) (map[string][]string, error) {
var expectedMetadata map[string][]string

ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_ = r.ParseMultipartForm(100000)
expectedMetadata = r.MultipartForm.Value
}))
defer ts.Close()

tarball, err := getTarballPath(repository)
if err != nil {
return nil, err
}

cmd := exec.Command(twine, "upload", tarball)
cmd.Env = append(cmd.Env, fmt.Sprintf("TWINE_REPOSITORY_URL=%s", ts.URL))
cmd.Env = append(cmd.Env, "TWINE_USERNAME=user")
cmd.Env = append(cmd.Env, "TWINE_PASSWORD=password")

cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Run()
if err != nil {
return nil, err
}

return expectedMetadata, nil
}

func getParserMetadata(repository string) (map[string][]string, error) {
tarball, err := getTarballPath(repository)
if err != nil {
return nil, err
}

result, err := parse.Parse(tarball)
if err != nil {
return nil, err
}

if len(result) != 1 {
return nil, fmt.Errorf("unexpected length: %d", len(result))
}

distribution := result[0]
return distribution.MetadataMap(), nil
}

func TestParse(t *testing.T) {
for _, repositoryUrl := range repositoryUrls {
log.Printf("testing %s", repositoryUrl)

err := clone(repositoryUrl)
if err != nil {
log.Fatal(err)
}

repositoryName, err := toRepositoryName(repositoryUrl)
assert.Nil(t, err)

err = buildDistribution(repositoryName)
assert.Nil(t, err)

expectedMetadata, err := getTwineMetadata(repositoryName)
assert.Nil(t, err)

actualMetadata, err := getParserMetadata(repositoryName)
assert.Nil(t, err)

assert.Empty(t, cmp.Diff(expectedMetadata, actualMetadata))

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {"Trent Mick"},    "author_email": {"[email protected]"}, +  "base_filename": {"appdirs-1.4.4.tar.gz"},    "blake2_256_digest": {"12619ed4a91f5c0990c611fcc5edbc071f05315c72b4c922e86db525bab0a263"},    "classifiers": {"Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ...},    ... // 2 identical entries    "description_content_type": {""},    "download_url": {""}, +  "dynamic": nil, +  "file_name": {"testdata/packages/appdirs/dist/appdirs-1.4.4.tar.gz"},    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {"https://github.com/ActiveState/appdirs"},    "keywords": {"application directory log cache user"},    ... // 4 identical entries    "metadata_version": {"2.1"},    "name": {"appdirs"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, +  "platforms": nil, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil, +  "provides_extras": nil,    "pyversion": {""}, +  "requires": nil, +  "requires_dist": nil, +  "requires_external": nil,    "requires_python": {">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"}, +  "safe_name": {"appdirs"},    ... // 3 identical and 3 inserted entries   } Test: TestParse

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {""},    "author_email": {""}, +  "base_filename": {"click-8.2.0.dev0.tar.gz"},    "blake2_256_digest": {"0d1603edc2083b267d6da83c1f9605642b276fc339271ef39398e37e38a93c78"},    "classifiers": {"Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", ...},    ... // 2 identical entries    "description_content_type": {"text/x-rst"},    "download_url": {""}, +  "dynamic": nil, +  "file_name": {"testdata/packages/click/dist/click-8.2.0.dev0.tar.gz"},    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {""},    "keywords": {""},    ... // 4 identical entries    "metadata_version": {"2.1"},    "name": {"click"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, +  "platforms": nil, -  "project_urls": { -  "Changes, https://click.palletsprojects.com/changes/", -  "Chat, https://discord.gg/pallets", -  "Documentation, https://click.palletsprojects.com/", -  "Donate, https://palletsprojects.com/donate", -  "Issue Tracker, https://github.com/pallets/click/issues/", -  "Source Code, https://github.com/pallets/click/", -  }, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil, +  "provides_extras": nil,    "pyversion": {""}, +  "requires": nil,    "requires_dist": {"colorama; platform_system == 'Windows'"}, +  "requires_external": nil,    "requires_python": {">=3.8"}, +  "safe_name": {"click"},    "sha256_digest": {"0479d732987e85eaa551ee7f949b347674116297600b9d1138cb3f7fc0c9be2f"}, +  "signed_base_filename": {"click-8.2.0.dev0.tar.gz.asc"}, +  "signed_filename": {"testdata/packages/click/dist/click-8.2.0.dev0.tar.gz.asc"},    ... // 2 identical and 1 inserted entries   } Test: TestParse

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {"Jason R. Coombs"},    "author_email": {"[email protected]"}, +  "base_filename": {"importlib_metadata-6.8.1.dev17+g353c3df.tar.gz"},    "blake2_256_digest": {"65aeba681e0be2a5859fbf39f9a4fd562eda72c0c2fbc08f2f2a3f9817151e0f"},    "classifiers": {"Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", ...},    ... // 2 identical entries    "description_content_type": {""},    "download_url": {""}, +  "dynamic": nil, +  "file_name": { +  "testdata/packages/importlib_metadata/dist/importlib_metadata-6.8.1.dev17+g353c3df.tar.gz", +  },    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {"https://github.com/python/importlib_metadata"},    "keywords": {""},    ... // 3 identical entries    "md5_digest": {"3a5f0a79762a1e2773c7b0d09c9db905"},    "metadata_version": {"2.1"}, -  "name": {"importlib-metadata"}, +  "name": {"importlib_metadata"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, +  "platforms": nil, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil,    "provides_extras": {"testing", "docs", "perf"},    "pyversion": {""}, +  "requires": nil,    "requires_dist": {"zipp>=0.5", `typing-extensions>=3.6.4; python_version < "3.8"`, `pytest>=6; extra == "testing"`, `pytest-checkdocs>=2.4; extra == "testing"`, ...}, +  "requires_external": nil,    "requires_python": {">=3.8"}, +  "safe_name": {"importlib-metadata"},    "sha256_digest": {"99f554fa1671d480b40501347f5f78e979d60aee24d2bd555c5e850b89483c57"}, +  "signed_base_filename": {"importlib_metadata-6.8.1.dev17+g353c3df.tar.gz.asc"}, +  "signed_filename": { +  "testdata/packages/importlib_metadata/dist/importlib_metadata-6.8.1.dev17+g353c3df.tar.gz.asc", +  },    ... // 2 identical and 1 inserted entries   } Test: TestParse

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {"John D. Hunter, Michael Droettboom"},    "author_email": {"Unknown <[email protected]>"}, +  "base_filename": {"matplotlib-3.9.0.dev0.tar.gz"},    "blake2_256_digest": {"eb18e7d672fda06a7bdcacbe9ed755e1e2672437ad4b5f067b8748ff7237c255"},    "classifiers": {"Development Status :: 5 - Production/Stable", "Framework :: Matplotlib", "Intended Audience :: Science/Research", "Intended Audience :: Education", ...},    ... // 2 identical entries    "description_content_type": {"text/markdown"},    "download_url": {""}, +  "dynamic": nil, +  "file_name": {"testdata/packages/matplotlib/dist/matplotlib-3.9.0.dev0.tar.gz"},    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {""},    "keywords": {""}, -  "license": { -  `License agreement for matplotlib versions 1.3.0 and later ========================================================= 1. This LICENSE AGREEMENT is between the Matplotlib Development Team ("MDT"), and the Individual or Organization ("Licensee") accessing and`..., -  }, +  "license": { +  `License agreement for matplotlib versions 1.3.0 and later ========================================================= 1. This LICENSE AGREEMENT is between the Matplotlib Development Team ("MDT"), and the Individual or Organization ("Licensee") accessing and `..., +  },    "maintainer": {""},    "maintainer_email": {""},    "md5_digest": {"3532692b8f4fd4966c306621b5f0dca2"},    "metadata_version": {"2.1"},    "name": {"matplotlib"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, +  "platforms": nil, -  "project_urls": { -  "Homepage, https://matplotlib.org", -  "Download, https://matplotlib.org/stable/users/installing/index.html", -  "Documentation, https://matplotlib.org", -  "Source code, https://github.com/matplotlib/matplotlib", -  "Bug tracker, https://github.com/matplotlib/matplotlib/issues", -  "Forum, https://discourse.matplotlib.org/", -  "Donate, https://numfocus.org/donate-to-matplotlib", -  }, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil,    "provides_extras": {"dev"},    "pyversion": {""}, +  "requires": nil,    "requires_dist": {"contourpy>=1.0.1", "cycler>=0.10", "fonttools>=4.22.0", "kiwisolver>=1.3.1", ...}, +  "requires_external": nil,    "requires_python": {">=3.9"}, +  "safe_name": {"matplotlib"},    "sha256_digest": {"2b58f0321ea0b60b1a9edaa11df4362ecb24e1fa9e47c435a525c1733d1389eb"}, +  "signed_base_filename": {

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {""},    "author_email": {"Sébastien Eustace <[email protected]>>"}, +  "base_filename": {"pendulum-3.0.0b1.tar.gz"},    "blake2_256_digest": {"20a89df32bba45cc7d8d5cb5ffad32c61bc55c8025c896327db67a0955808e8a"},    "classifiers": {"License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", ...},    ... // 2 identical entries    "description_content_type": {"text/x-rst; charset=UTF-8"},    "download_url": {""}, +  "dynamic": nil, +  "file_name": {"testdata/packages/pendulum/dist/pendulum-3.0.0b1.tar.gz"},    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {""},    "keywords": {"datetime,date,time"},    ... // 4 identical entries    "metadata_version": {"2.1"},    "name": {"pendulum"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, +  "platforms": nil, -  "project_urls": { -  "Homepage, https://pendulum.eustace.io", -  "Documentation, https://pendulum.eustace.io/docs", -  "Repository, https://github.com/sdispater/pendulum", -  }, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil, +  "provides_extras": nil,    "pyversion": {""}, +  "requires": nil,    "requires_dist": {"python-dateutil >=2.6, <3.0", "tzdata >=2020.1", "backports.zoneinfo >=0.2.1, <0.3.0 ; python_version >= '3.7' and"..., "time-machine >=2.6.0, <3.0.0 ; implementation_name != 'pypy'", ...}, +  "requires_external": nil,    "requires_python": {">=3.8"}, +  "safe_name": {"pendulum"},    "sha256_digest": {"a34a76f323e43d6c842e1a6caec8328b8add7f0422f40fec39074c7d1b22f3f2"}, +  "signed_base_filename": {"pendulum-3.0.0b1.tar.gz.asc"}, +  "signed_filename": {"testdata/packages/pendulum/dist/pendulum-3.0.0b1.tar.gz.asc"},    ... // 2 identical and 1 inserted entries   } Test: TestParse

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {"Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruyno"...},    "author_email": {""}, +  "base_filename": {"pytest-8.0.0.dev294+gc7e9b22f3.tar.gz"},    "blake2_256_digest": {"f9e992f92bd73bc4e0423b1733f542b39638662df429b0f3069e1050e4be2593"},    "classifiers": {"Development Status :: 6 - Mature", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", ...},    ... // 2 identical entries    "description_content_type": {"text/x-rst"},    "download_url": {""}, +  "dynamic": nil, +  "file_name": {"testdata/packages/pytest/dist/pytest-8.0.0.dev294+gc7e9b22f3.tar.gz"},    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {"https://docs.pytest.org/en/latest/"},    "keywords": {"test,unittest"},    ... // 4 identical entries    "metadata_version": {"2.1"},    "name": {"pytest"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, -  "platform": {"unix", "linux", "osx", "cygwin", "win32"}, +  "platforms": {"unix", "linux", "osx", "cygwin", "win32"}, -  "project_urls": { -  "Changelog, https://docs.pytest.org/en/stable/changelog.html", -  "Twitter, https://twitter.com/pytestdotorg", -  "Source, https://github.com/pytest-dev/pytest", -  "Tracker, https://github.com/pytest-dev/pytest/issues", -  }, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil,    "provides_extras": {"testing"},    "pyversion": {""}, +  "requires": nil,    "requires_dist": {"iniconfig", "packaging", "pluggy<2.0,>=1.3.0", `colorama; sys_platform == "win32"`, ...}, +  "requires_external": nil,    "requires_python": {">=3.8"}, +  "safe_name": {"pytest"},    "sha256_digest": {"f70cc757c150be7014bb366ca9c9540df1b8dc808a109c567e8fd826efb1ebd8"}, +  "signed_base_filename": {"pytest-8.0.0.dev294+gc7e9b22f3.tar.gz.asc"}, +  "signed_filename": {"testdata/packages/pytest/dist/pytest-8.0.0.dev294+gc7e9b22f3.tar.gz.asc"},    ... // 2 identical and 1 inserted entries   } Test: TestParse

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {"Trent Mick"},    "author_email": {"[email protected]"}, +  "base_filename": {"appdirs-1.4.4.tar.gz"},    "blake2_256_digest": {"d1d8c1d3309e8e14d2802ea133e4e382b7d0173a2b5dd5029acbe6b07924b45a"},    "classifiers": {"Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ...},    ... // 2 identical entries    "description_content_type": {""},    "download_url": {""}, +  "dynamic": nil, +  "file_name": {"testdata/packages/appdirs/dist/appdirs-1.4.4.tar.gz"},    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {"https://github.com/ActiveState/appdirs"},    "keywords": {"application directory log cache user"},    ... // 4 identical entries    "metadata_version": {"2.1"},    "name": {"appdirs"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, +  "platforms": nil, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil, +  "provides_extras": nil,    "pyversion": {""}, +  "requires": nil, +  "requires_dist": nil, +  "requires_external": nil,    "requires_python": {">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"}, +  "safe_name": {"appdirs"},    ... // 3 identical and 3 inserted entries   } Test: TestParse

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {""},    "author_email": {""}, +  "base_filename": {"click-8.2.0.dev0.tar.gz"},    "blake2_256_digest": {"a24db4724352e010544c4dd6811e73e6ef4cb4a8dcb2a5482449dcf60b519855"},    "classifiers": {"Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", ...},    ... // 2 identical entries    "description_content_type": {"text/x-rst"},    "download_url": {""}, +  "dynamic": nil, +  "file_name": {"testdata/packages/click/dist/click-8.2.0.dev0.tar.gz"},    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {""},    "keywords": {""},    ... // 4 identical entries    "metadata_version": {"2.1"},    "name": {"click"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, +  "platforms": nil, -  "project_urls": { -  "Changes, https://click.palletsprojects.com/changes/", -  "Chat, https://discord.gg/pallets", -  "Documentation, https://click.palletsprojects.com/", -  "Donate, https://palletsprojects.com/donate", -  "Issue Tracker, https://github.com/pallets/click/issues/", -  "Source Code, https://github.com/pallets/click/", -  }, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil, +  "provides_extras": nil,    "pyversion": {""}, +  "requires": nil,    "requires_dist": {"colorama; platform_system == 'Windows'"}, +  "requires_external": nil,    "requires_python": {">=3.8"}, +  "safe_name": {"click"},    "sha256_digest": {"650079ac4c3eaad010942eae19cf27f7daa235a43a8eacf79285c1176838df36"}, +  "signed_base_filename": {"click-8.2.0.dev0.tar.gz.asc"}, +  "signed_filename": {"testdata/packages/click/dist/click-8.2.0.dev0.tar.gz.asc"},    ... // 2 identical and 1 inserted entries   } Test: TestParse

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {"Jason R. Coombs"},    "author_email": {"[email protected]"}, +  "base_filename": {"importlib_metadata-6.8.1.dev17+g353c3df.tar.gz"},    "blake2_256_digest": {"014c0e9c696453c1e3c8b93b2b5799b942f5c84af7e0ab47a11ed5f01bf243ef"},    "classifiers": {"Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", ...},    ... // 2 identical entries    "description_content_type": {""},    "download_url": {""}, +  "dynamic": nil, +  "file_name": { +  "testdata/packages/importlib_metadata/dist/importlib_metadata-6.8.1.dev17+g353c3df.tar.gz", +  },    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {"https://github.com/python/importlib_metadata"},    "keywords": {""},    ... // 3 identical entries    "md5_digest": {"a9cd0eb4f136b8dd94625e365234cb7f"},    "metadata_version": {"2.1"}, -  "name": {"importlib-metadata"}, +  "name": {"importlib_metadata"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, +  "platforms": nil, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil,    "provides_extras": {"testing", "docs", "perf"},    "pyversion": {""}, +  "requires": nil,    "requires_dist": {"zipp>=0.5", `typing-extensions>=3.6.4; python_version < "3.8"`, `pytest>=6; extra == "testing"`, `pytest-checkdocs>=2.4; extra == "testing"`, ...}, +  "requires_external": nil,    "requires_python": {">=3.8"}, +  "safe_name": {"importlib-metadata"},    "sha256_digest": {"dfcf060217f6c7b0653d6f595df41f3512557e97d96ff19e2fc2f8363e4e18b6"}, +  "signed_base_filename": {"importlib_metadata-6.8.1.dev17+g353c3df.tar.gz.asc"}, +  "signed_filename": { +  "testdata/packages/importlib_metadata/dist/importlib_metadata-6.8.1.dev17+g353c3df.tar.gz.asc", +  },    ... // 2 identical and 1 inserted entries   } Test: TestParse

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {"John D. Hunter, Michael Droettboom"},    "author_email": {"Unknown <[email protected]>"}, +  "base_filename": {"matplotlib-3.9.0.dev0.tar.gz"},    "blake2_256_digest": {"96daaffc117d1f6ba031c5cbd55112d9d23f098b918ae6fcafcc4279ce580454"},    "classifiers": {"Development Status :: 5 - Production/Stable", "Framework :: Matplotlib", "Intended Audience :: Science/Research", "Intended Audience :: Education", ...},    ... // 2 identical entries    "description_content_type": {"text/markdown"},    "download_url": {""}, +  "dynamic": nil, +  "file_name": {"testdata/packages/matplotlib/dist/matplotlib-3.9.0.dev0.tar.gz"},    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {""},    "keywords": {""}, -  "license": { -  `License agreement for matplotlib versions 1.3.0 and later ========================================================= 1. This LICENSE AGREEMENT is between the Matplotlib Development Team ("MDT"), and the Individual or Organization ("Licensee") accessing and`..., -  }, +  "license": { +  `License agreement for matplotlib versions 1.3.0 and later ========================================================= 1. This LICENSE AGREEMENT is between the Matplotlib Development Team ("MDT"), and the Individual or Organization ("Licensee") accessing and `..., +  },    "maintainer": {""},    "maintainer_email": {""},    "md5_digest": {"897df79e4e6b72755e46348d3127e05c"},    "metadata_version": {"2.1"},    "name": {"matplotlib"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, +  "platforms": nil, -  "project_urls": { -  "Homepage, https://matplotlib.org", -  "Download, https://matplotlib.org/stable/users/installing/index.html", -  "Documentation, https://matplotlib.org", -  "Source code, https://github.com/matplotlib/matplotlib", -  "Bug tracker, https://github.com/matplotlib/matplotlib/issues", -  "Forum, https://discourse.matplotlib.org/", -  "Donate, https://numfocus.org/donate-to-matplotlib", -  }, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil,    "provides_extras": {"dev"},    "pyversion": {""}, +  "requires": nil,    "requires_dist": {"contourpy>=1.0.1", "cycler>=0.10", "fonttools>=4.22.0", "kiwisolver>=1.3.1", ...}, +  "requires_external": nil,    "requires_python": {">=3.9"}, +  "safe_name": {"matplotlib"},    "sha256_digest": {"7589824fd3243ceb168f6275e408d52c12ce86032b9bed4cc2bac19ccf77f5f6"}, +  "signed_base_filename": {

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {""},    "author_email": {"Sébastien Eustace <[email protected]>>"}, +  "base_filename": {"pendulum-3.0.0b1.tar.gz"},    "blake2_256_digest": {"0e1bb4968fe26bd206a6cd24538a7b3f88a6dacabd078fd1f422d95798780dc1"},    "classifiers": {"License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", ...},    ... // 2 identical entries    "description_content_type": {"text/x-rst; charset=UTF-8"},    "download_url": {""}, +  "dynamic": nil, +  "file_name": {"testdata/packages/pendulum/dist/pendulum-3.0.0b1.tar.gz"},    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {""},    "keywords": {"datetime,date,time"},    ... // 4 identical entries    "metadata_version": {"2.1"},    "name": {"pendulum"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, +  "platforms": nil, -  "project_urls": { -  "Homepage, https://pendulum.eustace.io", -  "Documentation, https://pendulum.eustace.io/docs", -  "Repository, https://github.com/sdispater/pendulum", -  }, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil, +  "provides_extras": nil,    "pyversion": {""}, +  "requires": nil,    "requires_dist": {"python-dateutil >=2.6, <3.0", "tzdata >=2020.1", "backports.zoneinfo >=0.2.1, <0.3.0 ; python_version >= '3.7' and"..., "time-machine >=2.6.0, <3.0.0 ; implementation_name != 'pypy'", ...}, +  "requires_external": nil,    "requires_python": {">=3.8"}, +  "safe_name": {"pendulum"},    "sha256_digest": {"5e285e3f07ec4d1c099b4633b45d24e5a9f02798cd6fab663bde441ca2217be0"}, +  "signed_base_filename": {"pendulum-3.0.0b1.tar.gz.asc"}, +  "signed_filename": {"testdata/packages/pendulum/dist/pendulum-3.0.0b1.tar.gz.asc"},    ... // 2 identical and 1 inserted entries   } Test: TestParse

Check failure on line 175 in parse_test.go

View workflow job for this annotation

GitHub Actions / test

parse_test.go:175: Error Trace: /home/runner/work/python-distribution-parser/python-distribution-parser/parse_test.go:175 Error: Should be empty, but was   map[string][]string{ -  ":action": {"file_upload"},    "author": {"Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruyno"...},    "author_email": {""}, +  "base_filename": {"pytest-8.0.0.dev294+gc7e9b22f3.tar.gz"},    "blake2_256_digest": {"e499989c2abdc7d890871d235a69e1d8a3ce776221fcfd3aaac114edb6bf86b5"},    "classifiers": {"Development Status :: 6 - Mature", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", ...},    ... // 2 identical entries    "description_content_type": {"text/x-rst"},    "download_url": {""}, +  "dynamic": nil, +  "file_name": {"testdata/packages/pytest/dist/pytest-8.0.0.dev294+gc7e9b22f3.tar.gz"},    "filetype": {"sdist"}, +  "gpg_signature": {"<nil>"},    "home_page": {"https://docs.pytest.org/en/latest/"},    "keywords": {"test,unittest"},    ... // 4 identical entries    "metadata_version": {"2.1"},    "name": {"pytest"}, +  "obsoletes": nil, +  "obsoletes_dist": nil, -  "platform": {"unix", "linux", "osx", "cygwin", "win32"}, +  "platforms": {"unix", "linux", "osx", "cygwin", "win32"}, -  "project_urls": { -  "Changelog, https://docs.pytest.org/en/stable/changelog.html", -  "Twitter, https://twitter.com/pytestdotorg", -  "Source, https://github.com/pytest-dev/pytest", -  "Tracker, https://github.com/pytest-dev/pytest/issues", -  }, +  "project_urls": nil,    "protocol_version": {"1"}, +  "provides": nil, +  "provides_dist": nil,    "provides_extras": {"testing"},    "pyversion": {""}, +  "requires": nil,    "requires_dist": {"iniconfig", "packaging", "pluggy<2.0,>=1.3.0", `colorama; sys_platform == "win32"`, ...}, +  "requires_external": nil,    "requires_python": {">=3.8"}, +  "safe_name": {"pytest"},    "sha256_digest": {"f6d496d849d25f385518a8723aa483e21fea508a2562e36382008b0469b14dc6"}, +  "signed_base_filename": {"pytest-8.0.0.dev294+gc7e9b22f3.tar.gz.asc"}, +  "signed_filename": {"testdata/packages/pytest/dist/pytest-8.0.0.dev294+gc7e9b22f3.tar.gz.asc"},    ... // 2 identical and 1 inserted entries   } Test: TestParse
}
}
Empty file added testdata/packages/.gitkeep
Empty file.

0 comments on commit 369d9d0

Please sign in to comment.