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

Drop use_2to3 and restore rdflib interoperability #105

Merged
merged 7 commits into from
Sep 10, 2021

Conversation

ajnelson-nist
Copy link
Contributor

This patch series has two goals:

  1. Remove the use_2to3 flag from setup.py, as setuptools#2770 set
    that flag to trigger an error. (Further discussion might ensue on
    setuptools#2779.)
  2. Perform minimal upgrades to have unit tests pass equally well to the
    state archived in July, whether rdflib 5.0.0 or 6.0.0 is present.
    (NOTE - it appears to me that unit tests do not pass in the July
    state, and this is noted in the first patch, which establishes the
    testing baseline. The end effect of this patch series leaves no new
    known failures.)

Together, these will make rdflib-jsonld continue to be a transparent
import, aiding users that did not realize, or cannot accommodate, that
the package had been integrated into rdflib.

More pragmatically, downstream builds depending on rdflib-jsonld should
no longer halt on reaching this dependency.

How to socialize the package being deprecated is left for a separate
patch series.

Tests were run with the following script, commenting out some portions
when fail states were expected:

#!/bin/bash

# This software was developed at the National Institute of Standards
# and Technology by employees of the Federal Government in the course
# of their official duties. Pursuant to title 17 Section 105 of the
# United States Code this software is not subject to copyright
# protection and is in the public domain. NIST assumes no
# responsibility whatsoever for its use by other parties, and makes
# no guarantees, expressed or implied, about its quality,
# reliability, or any other characteristic.
#
# We would appreciate acknowledgement if the software is used.

set -x
set -e
set -u

if [ ! -d venv0 ]; then
  python3 -m venv venv0
  source venv0/bin/activate
    pip install nose
    pip install rdflib==5.0.0
    pip install --editable .
  deactivate
fi

if [ ! -d venv1 ]; then
  python3 -m venv venv1
  source venv1/bin/activate
    pip install --upgrade setuptools nose
    pip install rdflib==5.0.0
    pip install --editable .
  deactivate
fi

if [ ! -d venv2 ]; then
  python3 -m venv venv2
  source venv2/bin/activate
    pip install nose
    pip install rdflib==6.0.0
    pip install --editable .
  deactivate
fi

if [ ! -d venv3 ]; then
  python3 -m venv venv3
  source venv3/bin/activate
    pip install --upgrade setuptools nose
    pip install rdflib==6.0.0
    pip install --editable .
  deactivate
fi

for x in 0 1 2 3 ; do
  source venv${x}/bin/activate
    nosetests || true
  deactivate
done

References:

Signed-off-by: Alex Nelson [email protected]

This patch establishes the baseline state of unit tests passing.

Unit test results: 5 tests report a FAIL status, all related to JSON-LD
compaction. I suggest that these tests are out of scope of the mission
of restoring builds functioning, related to removing the use_2to3 flag.

References:
* RDFLib/rdflib#1405

Signed-off-by: Alex Nelson <[email protected]>
The resolution of setuptools 2769 made any package using `use_2to3` to
fail its build.  This patch removes the flag, in support of outroducing
rdflib-jsonld.

The test suite is showing other follow-on patches will be necessary to
fix matters 2to3 had been quietly fixing along the way.  However, this
first patch does restore a working call to `pip install .` with
up-to-date setuptools.

Unit test results: This causes only the same five tests as were
previously failing to fail.

setuptools versions tested:
* 41.2.0
* 58.0.4

References:
* pypa/setuptools#2769
* RDFLib/rdflib#1405

Reported-by: Ralf Grubenmann <[email protected]>
Signed-off-by: Alex Nelson <[email protected]>
This is to prepare for rdflib 6.0.0.

The original rename was performed in this rdflib commit:
ceab6b2f71f97e45007b5306d2e0416bfefcea75

Unit test results: This causes only the same five tests as were
previously failing to fail.

Signed-off-by: Alex Nelson <[email protected]>
Unit test results: now reporting 135 errors, 1 failure (docstring).

Signed-off-by: Alex Nelson <[email protected]>
The upstream signature had changed in this commit:
1a5df0084c6f361c9059ac19e64d632ae503b9b3

Unit test results: This patch addresses 124 of 135 errors raised in the
unit tests.  Failure (docstring) remains.

Signed-off-by: Alex Nelson <[email protected]>
…ter strings

Graph.serialize() returns either a character string or a byte string in
rdflib 6.0.0.  This patch addresses the errors reported by nosetests.

Unit test results: This causes only the same five tests as were
initially failing to fail.

Signed-off-by: Alex Nelson <[email protected]>
This docstring was a new test failure reported by nosetests when trying
one last time to pin rdflib to pre-6.0.0.

With this patch, test results match when using rdflib 5.0.0 or 6.0.0.

Unit test results: This causes only the same five tests as were
initially failing to fail.

setuptools versions tested:
* 41.2.0
* 58.0.4

Signed-off-by: Alex Nelson <[email protected]>
Copy link
Member

@nicholascar nicholascar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all this preservation work @ajnelson-nist

@nicholascar nicholascar merged commit a23f1b3 into RDFLib:master Sep 10, 2021
ajnelson-nist added a commit to ajnelson-nist/rdflib-jsonld that referenced this pull request Sep 13, 2021
This was accidentally removed as part of this pull request:
RDFLib#105

Signed-off-by: Alex Nelson <[email protected]>
@Exagone313
Copy link

This is unexpected but thank you. This helps doing the transition with the setuptools issues.

BryceStevenWilley added a commit to BryceStevenWilley/mealie that referenced this pull request Sep 20, 2021
`extruct` depends on rdflib-jsonld, which had an error involving `use_2to3`
(RDFLib/rdflib-jsonld#105), which prevented
building.
robons pushed a commit to ONSdigital/csvcubed that referenced this pull request Sep 20, 2021
robons pushed a commit to ONSdigital/csvcubed that referenced this pull request Sep 20, 2021
canwaf pushed a commit to ONSdigital/csvcubed that referenced this pull request Sep 20, 2021
…kage files (#176)

* Upgrading rdflib-jsonld due to breaking change in latest version of python.

RDFLib/rdflib-jsonld#105

* Ensuring that the devtools package actually includes the relevant package files.
hay-kot added a commit to mealie-recipes/mealie that referenced this pull request Sep 23, 2021
* Shopping list quantity decrement button -> minus

Missed being renamed when material design icons were moved
to be global variables, still used the original md name.

* Updated poetry lock to fix rdflib-jsonld error

`extruct` depends on rdflib-jsonld, which had an error involving `use_2to3`
(RDFLib/rdflib-jsonld#105), which prevented
building.

* update poetry CI/CD Version

Co-authored-by: Hayden <[email protected]>
hay-kot added a commit to mealie-recipes/mealie that referenced this pull request Dec 1, 2021
* Shopping list quantity decrement button -> minus

Missed being renamed when material design icons were moved
to be global variables, still used the original md name.

* Updated poetry lock to fix rdflib-jsonld error

`extruct` depends on rdflib-jsonld, which had an error involving `use_2to3`
(RDFLib/rdflib-jsonld#105), which prevented
building.

* update poetry CI/CD Version

Co-authored-by: Hayden <[email protected]>
hay-kot added a commit to mealie-recipes/mealie that referenced this pull request Dec 1, 2021
* Shopping list quantity decrement button -> minus

Missed being renamed when material design icons were moved
to be global variables, still used the original md name.

* Updated poetry lock to fix rdflib-jsonld error

`extruct` depends on rdflib-jsonld, which had an error involving `use_2to3`
(RDFLib/rdflib-jsonld#105), which prevented
building.

* update poetry CI/CD Version

Co-authored-by: Hayden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants