Repository: pralab/secml (language: python)

Issue:
Support for Python 3.10
SecML now supports Python < 3.10. 

Support for Python 3.10 should be added, as now it is also needed for running experiments on Google Colab.


Discussion / hints:

Fix patch:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
deleted file mode 100644
index 75632782..00000000
--- a/.gitlab-ci.yml
+++ /dev/null
@@ -1,633 +0,0 @@
-include:
-  - template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
-  - template: 'Jobs/Code-Quality.gitlab-ci.yml'
-  - template: 'Security/SAST.gitlab-ci.yml'
-  - template: 'Security/Secret-Detection.gitlab-ci.yml'
-
-variables:
-  SEARCH_MAX_DEPTH: 6
-  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
-  PIP_FIND_LINKS_TORCH: "https://download.pytorch.org/whl/cpu/torch_stable.html"
-  TORCH_HOME: "$CI_PROJECT_DIR/.cache/torch"
-  SECML_HOME_DIR: "$CI_PROJECT_DIR/secml-data"
-  TOX_WORKDIR: "$CI_PROJECT_DIR/.tox"
-  TOX_TESTENV_PASSENV: "PIP_CACHE_DIR PIP_FIND_LINKS_TORCH TORCH_HOME SECML_HOME_DIR"
-  TOX_USEDEVELOP: "False"
-
-stages:
-  - package
-  - test
-  - sync
-  - release
-  - triage
-
-
-.shared_windows_runners:
-  tags:
-  - shared-windows
-  - windows
-  - windows-1809
-
-
-.test-cache:
-  cache: &test-cache
-    paths:
-      - $PIP_CACHE_DIR
-      - $TORCH_HOME
-      - $SECML_HOME_DIR
-
-
-.package:
-  stage: package
-  interruptible: true
-
-package:
-  extends: .package
-  image: ${CI_REGISTRY}/pralab/docker-helper-images/python36-setuptools:latest
-  before_script:
-    - echo $CI_PROJECT_DIR
-  script:
-    - python setup.py sdist --formats=zip
-    - python setup.py bdist_wheel --universal
-    - twine check dist/*
-  rules:
-    - if: '$RUN_TESTS'
-      when: on_success
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'
-      when: never
-    - changes:
-      - src/secml/**/*
-      - .gitlab-ci.yml
-      - CHANGELOG.md
-      - MANIFEST.in
-      - README.md
-      - requirements.txt
-      - setup.py
-      - tox.ini
-      when: on_success
-  artifacts:
-    name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}"
-    paths:
-      - ${CI_PROJECT_DIR}/dist/${CI_PROJECT_NAME}-*.zip
-      - ${CI_PROJECT_DIR}/dist/${CI_PROJECT_NAME}-*.whl
-    expire_in: 1 week
-
-package:docs:
-  extends: .package
-  image: ${CI_REGISTRY}/pralab/docker-helper-images/python36-sphinx:latest
-  script:
-    - echo $CI_PROJECT_DIR
-    - python -V
-    - pip install tox
-    - tox -e docs
-    - mv docs/build/html/ public/
-  rules:
-    - if: '$RUN_TESTS'
-      when: on_success
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'
-      when: never
-    - changes:
-      - docs/**/*
-      - tutorials/**/*
-      - src/secml/**/*
-      - .gitlab-ci.yml
-      - CHANGELOG.md
-      - README.md
-      - requirements.txt
-      - setup.py
-      - tox.ini
-      when: on_success
-  artifacts:
-    name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_DOCS"
-    paths:
-      - public
-    expire_in: 1 day
-  cache:
-    key: "test-cache-py36"
-    paths:
-      - "$CI_PROJECT_DIR/.cache/pip"
-      - "$CI_PROJECT_DIR/secml-data"
-    policy: pull
-
-
-code_quality:
-  interruptible: true  
-  rules:
-    - if: '$CODE_QUALITY_DISABLED'
-      when: never
-    - if: '$CI_COMMIT_BRANCH == "stable" || $CI_COMMIT_BRANCH =~ /^release-.*$/ || $CI_COMMIT_BRANCH =~ /^.*-stable$/'
-      when: never
-    - if: '$CI_COMMIT_BRANCH'
-  variables:
-    REPORT_FORMAT: html
-  artifacts:
-    paths: [gl-code-quality-report.html]
-
-
-.test:
-  stage: test
-  needs: ["package"]
-  interruptible: true
-  before_script:
-    - echo $CI_PROJECT_DIR
-    - python -V
-    - pip install tox
-  rules:
-    - if: '$RUN_TESTS'
-      when: on_success
-    - if: '$SKIP_TESTS'
-      when: never
-    - if: '$CI_PIPELINE_SOURCE == "web"'
-      when: on_success
-    - if: '$CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "tags"'
-      when: never
-    - changes:
-      - src/secml/VERSION
-      when: never
-    - changes:
-      - src/secml/**/*
-      - .gitlab-ci.yml
-      - requirements.txt
-      - setup.py
-      - tox.ini
-      when: on_success
-
-.test-report:
-  artifacts: &pytest-report
-    reports:
-      junit: pytest-report.xml
-    expire_in: 1 week
-
-test:py36:latest:
-  extends: .test
-  image: python:3.6
-  script: tox -e py36
-  cache: &test-cache-py36
-    key: "test-cache-py36"
-    <<: *test-cache
-  artifacts: *pytest-report
-
-test:py36:min:
-  extends: .test
-  image: python:3.6
-  script: tox -e py36-min
-  cache: &test-cache-py36-min
-    key: "test-cache-py36-min"
-    <<: *test-cache
-  artifacts: *pytest-report
-
-test:py37:latest:
-  extends: .test
-  image: python:3.7
-  script: tox -e py37
-  cache: &test-cache-py37
-    key: "test-cache-py37"
-    <<: *test-cache
-  artifacts: *pytest-report
-
-test:py37:min:
-  extends: .test
-  image: python:3.7
-  script: tox -e py37-min
-  cache: &test-cache-py37-min
-    key: "test-cache-py37-min"
-    <<: *test-cache
-  artifacts: *pytest-report
-
-test:py38:latest:
-  extends: .test
-  image: python:3.8
-  script: tox -e py38
-  cache: &test-cache-py38
-    key: "test-cache-py38"
-    <<: *test-cache
-  artifacts: *pytest-report
-
-test:py38:min:
-  extends: .test
-  image: python:3.8
-  script: tox -e py38-min
-  cache: &test-cache-py38-min
-    key: "test-cache-py38-min"
-    <<: *test-cache
-  artifacts: *pytest-report
-
-test:py36:latest:win:
-  extends:
-    - .test
-    - .shared_windows_runners
-  image: python:3.6
-  rules:
-    - if: '$CI_SERVER_HOST != "gitlab.com"'
-      when: never
-    - if: '$RUN_TESTS'
-      when: on_success
-    - if: '$SKIP_TESTS'
-      when: never
-    - if: '$CI_PIPELINE_SOURCE == "web"'
-      when: on_success
-    - if: '$CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "tags"'
-      when: never
-    - changes:
-      - src/secml/VERSION
-      when: never
-    - changes:
-      - src/secml/**/*
-      - .gitlab-ci.yml
-      - requirements.txt
-      - setup.py
-      - tox.ini
-      when: on_success
-  before_script:
-    - echo $CI_PROJECT_DIR
-    - choco install vcredist2017 -y
-    - choco install python -y --version=3.6.8
-    # Path is not updated by default by choco
-    - $env:Path += ";C:\Python36;C:\Python36\Scripts"
-    - python -V
-    # If matplotlib cannot find the following registry item tries to read the "WINDIR" env key (caps) and crashes
-    - New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" -Name "Fonts" -Value "C:\Windows\Fonts" -PropertyType "String"
-    # The https://download.pytorch.org/ certificates chain is not recognized by default as trusted
-    - Import-Certificate -FilePath ".gitlab\dl-pytorch-chain.p7b" -CertStoreLocation Cert:\LocalMachine\Root
-    - pip install tox
-  script: tox -e py36-win
-  allow_failure: true
-  cache: &test-cache-py36-win
-    key: "test-cache-py36-win"
-    <<: *test-cache
-  artifacts: *pytest-report
-
-test:py36:latest:noextras:
-  extends: .test
-  image: python:3.6
-  script: tox -e py36-nopytorch-nocleverhans-nofoolbox
-  cache: *test-cache-py36
-  artifacts: *pytest-report
-
-
-.test:notebooks:
-  extends: .test
-  needs: []
-  rules:
-    - if: '$RUN_TESTS'
-      when: on_success
-    - if: '$SKIP_TESTS'
-      when: never
-    - if: '$CI_PIPELINE_SOURCE == "web"'
-      when: on_success
-    - if: '$CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "tags"'
-      when: never
-    - changes:
-      - src/secml/VERSION
-      when: never
-    - changes:
-      - src/secml/**/*
-      - tutorials/**/*
-      - .gitlab-ci.yml
-      - requirements.txt
-      - setup.py
-      - tox.ini
-      when: on_success
-
-test:notebooks:py36:latest:
-  extends: .test:notebooks
-  image: python:3.6
-  script: tox -e latest-notebooks
-  cache: *test-cache-py36
-
-
-test:zoo:
-  stage: test
-  needs: ["package"]
-  allow_failure: true
-  variables:
-    SECML_ZOO_BRANCH: master
-    PIP_CACHE_DIR: $PIP_CACHE_DIR
-    TORCH_HOME: $TORCH_HOME
-    SECML_HOME_DIR: $SECML_HOME_DIR
-  trigger:
-    project: secml/secml-zoo
-    branch: $SECML_ZOO_BRANCH
-    strategy: depend
-  rules:
-    - if: '$CI_SERVER_HOST != "gitlab.com"'
-      when: never
-    - if: '$RUN_TESTS'
-      when: on_success
-    - if: '$SKIP_TESTS'
-      when: never
-    - if: '$CI_PIPELINE_SOURCE == "web"'
-      when: on_success
-    - if: '$CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "tags"'
-      when: never
-    - changes:
-      - src/secml/VERSION
-      when: never
-    - changes:
-      - src/secml/**/*
-      - .gitlab-ci.yml
-      - requirements.txt
-      - setup.py
-      - tox.ini
-      when: on_success
-
-
-.test:install:
-  stage: test
-  needs: ["package"]
-  interruptible: true
-  before_script:
-    - echo $CI_PROJECT_DIR
-    - python -V
-  after_script:
-    - python -c "import secml"
-  rules:
-    - if: '$RUN_TESTS'
-      when: on_success
-    - if: '$SKIP_TESTS'
-      when: never
-    - if: '$CI_PIPELINE_SOURCE == "tags" || $CI_PIPELINE_SOURCE == "web"'
-      when: on_success
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'
-      when: never
-    - if: '$CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "stable" || $CI_COMMIT_BRANCH =~ /^release-.*$/ || $CI_COMMIT_BRANCH =~ /^.*-stable$/'
-      changes:
-      - src/secml/**/*
-      - .gitlab-ci.yml
-      - CHANGELOG.md
-      - MANIFEST.in
-      - README.md
-      - requirements.txt
-      - setup.py
-      - tox.ini
-      when: on_success
-
-.test:install:whl:
-  extends: .test:install
-  script:
-    - DIST_WHL=$(find $CI_PROJECT_DIR/dist -iname \*.whl -exec basename {} \;)
-    - echo $DIST_WHL
-    - pip install ${CI_PROJECT_DIR}/dist/${DIST_WHL}
-
-.test:install:whl:extras:
-  extends: .test:install:whl
-  variables:
-    PIP_FIND_LINKS: $PIP_FIND_LINKS_TORCH
-  script:
-    - DIST_WHL=$(find $CI_PROJECT_DIR/dist -iname \*.whl -exec basename {} \;)
-    - echo $DIST_WHL
-    - pip install ${CI_PROJECT_DIR}/dist/${DIST_WHL}[pytorch,cleverhans,foolbox]
-  after_script:
-    - python -c "import secml"
-    - python -c "from secml.ml.classifiers import CClassifierPyTorch"
-    - python -c "from secml.adv.attacks.evasion import CAttackEvasionCleverhans"
-    - python -c "from secml.adv.attacks.evasion import CAttackEvasionFoolbox"
-
-test:install:whl:py36:
-  extends: .test:install:whl
-  image: python:3.6
-  cache:
-    <<: *test-cache-py36
-    policy: pull
-
-test:install:whl:py37:
-  extends: .test:install:whl
-  image: python:3.7
-  cache:
-    <<: *test-cache-py37
-    policy: pull
-
-test:install:whl:py38:
-  extends: .test:install:whl
-  image: python:3.8
-  cache:
-    <<: *test-cache-py38
-    policy: pull
-
-test:install:whl:extras:py36:
-  extends: .test:install:whl:extras
-  image: python:3.6
-  cache:
-    <<: *test-cache-py36
-    policy: pull
-
-test:install:whl:extras:py37:
-  extends: .test:install:whl:extras
-  image: python:3.7
-  cache:
-    <<: *test-cache-py37
-    policy: pull
-
-test:install:whl:extras:py38:
-  extends: .test:install:whl:extras
-  image: python:3.8
-  script:
-    - DIST_WHL=$(find $CI_PROJECT_DIR/dist -iname \*.whl -exec basename {} \;)
-    - echo $DIST_WHL
-    - pip install ${CI_PROJECT_DIR}/dist/${DIST_WHL}[pytorch,foolbox]
-  after_script:
-    - python -c "import secml"
-    - python -c "from secml.ml.classifiers import CClassifierPyTorch"
-    - python -c "from secml.adv.attacks.evasion import CAttackEvasionFoolbox"
-  cache:
-    <<: *test-cache-py38
-    policy: pull
-
-
-.upstream-ssh:
-  before_script: &upstream-ssh
-    # Activate the ssh agent
-    - eval $(ssh-agent -s)
-
-    ## We're using tr to fix line endings which makes ed25519 keys work
-    ## without extra base64 encoding.
-    ## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
-    ##
-    - echo "$SSH_UPSTREAM_KEY" | tr -d '\r' | ssh-add -
-
-    # Create .ssh folder and set correct permissions
-    - mkdir -p ~/.ssh
-    - chmod 700 ~/.ssh
-
-    # Set user/email to use git commands
-    - git config --global user.email "$GITLAB_USER_EMAIL"
-    - git config --global user.name "$GITLAB_USER_NAME"
-
-    # Add known hosts validation keys
-    - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
-    - chmod 644 ~/.ssh/known_hosts
-
-
-.sync:
-  stage: sync
-  image: ${CI_REGISTRY}/pralab/docker-helper-images/alpine-release:latest
-  dependencies: []  # We do not need artifacts for jobs in this stage
-
-sync:upstream-repo:
-  extends: .sync
-  before_script: *upstream-ssh
-  variables:
-    CI_UPSTREAM_REPO: secml/secml.git
-    CI_UPSTREAM_BRANCH: master
-  script:
-    # Validate access to ssh
-    - ssh -T git@gitlab.com
-    # Add upstream repository as new remote (workaround for fatal: remote upstream already exists.)
-    - git config remote.upstream.url >&- || git remote add upstream git@gitlab.com:$CI_UPSTREAM_REPO
-    # Fetch remote, merge local and push to upstream
-    - git fetch upstream $CI_UPSTREAM_BRANCH
-    # Checkout current HEAD as branch (delete branch first if exists))
-    - git branch -D $CI_COMMIT_BRANCH &>/dev/null || true
-    - git checkout -b $CI_COMMIT_BRANCH
-    # Checkout the upstream branch using unique name (delete branch first if exists)
-    - git branch -D up-$CI_UPSTREAM_BRANCH &>/dev/null || true
-    - git checkout -b up-$CI_UPSTREAM_BRANCH upstream/$CI_UPSTREAM_BRANCH
-    # Merge local branch into upstream (here any conflict will make the job fail)
-    - git merge $CI_COMMIT_BRANCH --no-edit
-    # Push to upstream
-    - git push upstream up-$CI_UPSTREAM_BRANCH:$CI_UPSTREAM_BRANCH
-  rules:
-    - if: '$RUN_SYNC'
-      when: on_success
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'
-      when: never
-    - if: '$CI_COMMIT_BRANCH == "develop"'
-      when: on_success
-  allow_failure: true
-
-
-.release:
-  stage: release
-  image: ${CI_REGISTRY}/pralab/docker-helper-images/alpine-release:latest
-  only:
-    - tags
-  when: manual
-
-release:gitlab-releases:
-  extends: .release
-  before_script:
-    - apk add unzip
-    - echo $CI_PROJECT_ID
-    - echo $CI_COMMIT_TAG
-  script:
-    - DIST_ZIP=$(find $CI_PROJECT_DIR/dist -iname \*.zip -exec basename {} \;)
-    - echo $DIST_ZIP
-    - 'curl -s --request POST --header "PRIVATE-TOKEN: $API_ACCESS_TOKEN" --data name="$DIST_ZIP" --data url="$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/raw/dist/$DIST_ZIP?job=release:gitlab-releases" --data link_type="package" $CI_PROJECT_DOMAIN/api/v4/projects/$CI_PROJECT_ID/releases/$CI_COMMIT_TAG/assets/links'
-    - DIST_WHL=$(find $CI_PROJECT_DIR/dist -iname \*.whl -exec basename {} \;)
-    - echo $DIST_WHL
-    - 'curl -s --request POST --header "PRIVATE-TOKEN: $API_ACCESS_TOKEN" --data name="$DIST_WHL" --data url="$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/raw/dist/$DIST_WHL?job=release:gitlab-releases" --data link_type="package" $CI_PROJECT_DOMAIN/api/v4/projects/$CI_PROJECT_ID/releases/$CI_COMMIT_TAG/assets/links'
-  artifacts:  # Keep the distribution package (default expire 0)
-    name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}"
-    paths:
-      - ${CI_PROJECT_DIR}/dist/${CI_PROJECT_NAME}-*.zip
-      - ${CI_PROJECT_DIR}/dist/${CI_PROJECT_NAME}-*.whl
-    expire_in: never
-
-release:gitlab-repo:
-  extends: .release
-  before_script: *upstream-ssh
-  variables:
-    CI_UPSTREAM_REPO: secml/secml.git
-  dependencies: []  # We do not need artifacts in this job
-  script:
-    # Validate access to ssh
-    - ssh -T git@gitlab.com
-    # Use main TAG version (excluding e.g. "-rc1" suffix)
-    - CI_UPSTREAM_BRANCH=release-$(echo $CI_COMMIT_TAG | ( IFS="-$IFS" ; read a b && echo $a ))
-    # Clone gitlab.com repository
-    - git clone -b $CI_UPSTREAM_BRANCH git@gitlab.com:$CI_UPSTREAM_REPO gitlab-secml
-    # Remove all files in target repository (excluding .git folder)
-    - find gitlab-secml -mindepth 1 -maxdepth 1 -not -name .git -exec rm -rv {} +
-    # Copy al files in target repository (excluding .git folder and target repo folder)
-    - find . -mindepth 1 -maxdepth 1 -not -name .git -not -name gitlab-secml -exec cp -r {} gitlab-secml/ \;
-    # Commit and push
-    - cd gitlab-secml
-    - git add .  # .gitignore will properly exclude what should be excluded
-    - git commit -m "Release $CI_COMMIT_TAG"
-    - git push
-
-release:gitlab-pages:
-  extends: .release
-  before_script: *upstream-ssh
-  variables:
-    CI_PAGES_REPO: secml/secml.gitlab.io.git
-    CI_PAGES_URL: secml.gitlab.io
-    CI_PAGES_BRANCH: master
-  script:
-    # Validate access to ssh
-    - ssh -T git@gitlab.com
-    # Clone gitlab.com-pages repository
-    - git clone -b $CI_PAGES_BRANCH git@gitlab.com:$CI_PAGES_REPO
-    - cd $CI_PAGES_URL
-    # Remove current release
-    - rm -r src/*
-    # Copy generated release (from `package:docs`)
-    - cp -r ../public/* src/
-    # Commit and push
-    - git add src/*
-    - git commit -m "Release $CI_COMMIT_TAG"
-    - git push
-
-release:zoo:
-  stage: release
-  variables:
-    RELEASE: $CI_COMMIT_TAG
-    PIP_CACHE_DIR: $PIP_CACHE_DIR
-    TORCH_HOME: $TORCH_HOME
-    SECML_HOME_DIR: $SECML_HOME_DIR
-  trigger:
-    project: secml/secml-zoo
-    strategy: depend
-  rules:
-    - if: '$CI_SERVER_HOST != "gitlab.com"'
-      when: never
-    - if: $CI_COMMIT_TAG
-      when: manual
-
-release:pypi:
-  extends: .release
-  image: ${CI_REGISTRY}/pralab/docker-helper-images/python36-setuptools:latest
-  variables:
-    TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"
-    TWINE_USERNAME: __token__
-  script:
-    - twine upload $CI_PROJECT_DIR/dist/*
-
-release:pypi:dry:
-  extends: release:pypi
-  variables:
-    TWINE_REPOSITORY_URL: "https://test.pypi.org/legacy/"
-    TWINE_USERNAME: __token__
-  script:
-    - twine upload -p $TWINE_PASSWORD_TEST $CI_PROJECT_DIR/dist/*
-  only:
-    - tags
-    - web
-
-
-.triage:
-  image: ruby:latest
-  needs: []
-  cache: {}
-  allow_failure: true
-  before_script:
-    - gem install gitlab-triage
-    - export SSL_CERT_FILE=$CI_SERVER_TLS_CA_FILE
-
-triage:run:
-  stage: triage
-  extends: .triage
-  script:
-    - gitlab-triage -r $CI_PROJECT_DIR/.gitlab/triage_extra.rb --debug --host-url $CI_PROJECT_DOMAIN --token $API_ACCESS_TOKEN --source-id $CI_PROJECT_PATH --policies-file $CI_PROJECT_DIR/.gitlab/triage-policies.yml
-  rules:
-    - if: '$RUN_TRIAGE'
-      when: always
-
-triage:run:dry:
-  stage: triage
-  extends: .triage
-  script:
-    - gitlab-triage -r $CI_PROJECT_DIR/.gitlab/triage_extra.rb --dry-run --debug --host-url $CI_PROJECT_DOMAIN --token $API_ACCESS_TOKEN --source-id $CI_PROJECT_PATH --policies-file $CI_PROJECT_DIR/.gitlab/triage-policies.yml
-  only:
-    - web
-  when: manual
diff --git a/.gitlab/dl-pytorch-chain.p7b b/.gitlab/dl-pytorch-chain.p7b
deleted file mode 100644
index 52453b0a..00000000
Binary files a/.gitlab/dl-pytorch-chain.p7b and /dev/null differ
diff --git a/.gitlab/issue_templates/Bug.md b/.gitlab/issue_templates/Bug.md
deleted file mode 100644
index f92aa8d3..00000000
--- a/.gitlab/issue_templates/Bug.md
+++ /dev/null
@@ -1,32 +0,0 @@
-<!---
-Please read this!
-
-Before opening a new issue, make sure to search for keywords in the issues
-filtered by the "bug" label.
-
-- https://pragit.diee.unica.it/secml/secml/issues?label_name%5B%5D=bug
-
-and verify the issue you're about to submit isn't a duplicate.
---->
-
-(Summarize the bug encountered concisely)
-
-### Steps to reproduce
-
-(How one can reproduce the issue - **this is very important**)
-
-### [optional] What is the expected *correct* behavior?
-
-(What you are supposed to see in absence of the bug)
-
-### [optional] Relevant logs, screenshots, CI/CD tests
-
-(Paste any relevant logs, screenshots or links to specific CI/CD jobs 
-that are failing  - please use code blocks (```) to format console output,
-logs, and code as it's very hard to read otherwise.)
-
-### [optional] Possible fixes
-
-(Propose a possible fix for the reported problem)
-
-/label ~bug
diff --git a/.gitlab/issue_templates/Direction.md b/.gitlab/issue_templates/Direction.md
deleted file mode 100644
index 91beb28b..00000000
--- a/.gitlab/issue_templates/Direction.md
+++ /dev/null
@@ -1,28 +0,0 @@
-<!---
-Please read this!
-
-Before opening a new issue, make sure to search for keywords in the issues
-filtered by the "direction" label.
-
-- https://pragit.diee.unica.it/secml/secml/issues?label_name%5B%5D=direction
-
-and verify the issue you're about to submit isn't a duplicate.
---->
-
-(Summarize the direction feature to be developed.)
-
-## Todo list
-
-(List of issues to tackle specific components part of the direction. 
-After all issues in this list have been completed, direction issue can be closed.)
-
-* [ ] Issue title #ID
-* [ ] Issue title #ID
-
-## Related issues
-
-(List of related issues but not part of the direction itself)
-
-#ID1, #ID2, ...
-
-/label ~direction 
diff --git a/.gitlab/issue_templates/Documentation.md b/.gitlab/issue_templates/Documentation.md
deleted file mode 100644
index c167307a..00000000
--- a/.gitlab/issue_templates/Documentation.md
+++ /dev/null
@@ -1,18 +0,0 @@
-<!---
-Please read this!
-
-Before opening a new issue, make sure to search for keywords in the issues
-filtered by the "documentation" label.
-
-- https://pragit.diee.unica.it/secml/secml/issues?label_name%5B%5D=documentation
-
-and verify the issue you're about to submit isn't a duplicate.
---->
-
-(Describe the documentation to be added or changed.
-For code documentation, e.g. the doc for a class or a method, 
-a link to the related code should be provided.
-Documentation is located in "docs/source" and follows the reST format.
-**No code changes should be implemented**)
-
-/label ~documentation  
diff --git a/.gitlab/issue_templates/Improvement.md b/.gitlab/issue_templates/Improvement.md
deleted file mode 100644
index 61a1d4df..00000000
--- a/.gitlab/issue_templates/Improvement.md
+++ /dev/null
@@ -1,19 +0,0 @@
-<!---
-Please read this!
-
-Before opening a new issue, make sure to search for keywords in the issues
-filtered by the "improvement" label.
-
-- https://pragit.diee.unica.it/secml/secml/issues?label_name%5B%5D=improvement
-
-and verify the issue you're about to submit isn't a duplicate.
---->
-
-(Summarize the improvement to be developed.)
-
-### Implementation plan
-
-(Describe the implementation details including code snippets if applicable.
-Use code blocks (```) to make snippets properly readable.)
-
-/label ~improvement 
diff --git a/.gitlab/issue_templates/NewFeature.md b/.gitlab/issue_templates/NewFeature.md
deleted file mode 100644
index 9c6d6d0c..00000000
--- a/.gitlab/issue_templates/NewFeature.md
+++ /dev/null
@@ -1,23 +0,0 @@
-<!---
-Please read this!
-
-Before opening a new issue, make sure to search for keywords in the issues
-filtered by the "new feature" label.
-
-- https://pragit.diee.unica.it/secml/secml/issues?label_name%5B%5D=new+feature
-
-and verify the issue you're about to submit isn't a duplicate.
---->
-
-(Summarize the new feature to be developed. For implementing bigger/broader features, 
-a direction issue could be created instead.)
-
-### Implementation plan
-
-(Describe the implementation details. The plan should define, for example, 
-the name of the new classes/methods to implement and their position in the library. 
-It should also define what the new procedures to implement should do, 
-e.g. in terms of input/output for new methods. Include code snippets if applicable.
-Use code blocks (```) to make snippets properly readable.)
-
-/label ~"new feature" 
diff --git a/.gitlab/issue_templates/Refactoring.md b/.gitlab/issue_templates/Refactoring.md
deleted file mode 100644
index 4ada7977..00000000
--- a/.gitlab/issue_templates/Refactoring.md
+++ /dev/null
@@ -1,20 +0,0 @@
-<!---
-Please read this!
-
-Before opening a new issue, make sure to search for keywords in the issues
-filtered by the "refactoring" label.
-
-- https://pragit.diee.unica.it/secml/secml/issues?label_name%5B%5D=refactoring
-
-and verify the issue you're about to submit isn't a duplicate.
---->
-
-(Summarize the refactoring to be performed. **The interface of functions/classes 
-and their output should not change.**)
-
-### Implementation plan
-
-(Describe the implementation details including code snippets if applicable.
-Use code blocks (```) to make snippets properly readable.)
-
-/label ~refactoring  
diff --git a/.gitlab/merge_request_templates/Standard.md b/.gitlab/merge_request_templates/Standard.md
deleted file mode 100644
index 371ca396..00000000
--- a/.gitlab/merge_request_templates/Standard.md
+++ /dev/null
@@ -1,6 +0,0 @@
-## Changelog
-- Changelog line 1 [#ISSUEID]
-- Changelog line 1 [#ISSUEID]
-
-Closes #ISSUEID, #ISSUEID <!--- Add only issues that should be closed by this MR --->
-[Related to #ISSUEID, #ISSUEID] <!--- Add only issues that are referenced by this MR but are NOT going to be closed --->
\ No newline at end of file
diff --git a/.gitlab/triage-policies.yml b/.gitlab/triage-policies.yml
deleted file mode 100644
index 7c2e8767..00000000
--- a/.gitlab/triage-policies.yml
+++ /dev/null
@@ -1,118 +0,0 @@
-resource_rules:
-  issues:
-    rules:
-      - name: UnlabelledIssues
-        conditions:
-          date:
-            attribute: updated_at
-            condition: older_than
-            interval_type: days
-            interval: 5
-          state: opened
-          labels:
-            - No Label
-        limits:
-          most_recent: 50
-        actions:
-          mention:
-            - m.melis
-          comment: |
-            {{author}} This issue is unlabelled after 5 days. It needs attention. Please take care of this before the end of #{2.days.from_now.strftime('%Y-%m-%d')}
-      - name: RemovePriorityAfterClosing
-        conditions:
-          date:
-            attribute: updated_at
-            condition: older_than
-            interval_type: days
-            interval: 1
-          state: closed
-          labels:
-            - priority-{medium, high}
-        limits:
-          oldest: 50
-        actions:
-          remove_labels:
-            - priority-medium
-            - priority-high
-      - name: SetMilestoneLabel
-        conditions:
-          ruby: |
-            milestone&.title && milestone_open? && !has_milestone_label?
-        actions:
-          comment: |
-            /label ~"#{ milestone.title }"
-            #{ unlabel_no_milestone_labels }
-      - name: PublicLink
-        conditions:
-          date:
-            attribute: updated_at
-            condition: newer_than
-            interval_type: days
-            interval: 5
-          labels:
-            - public
-          forbidden_labels:
-            - public-linked
-        actions:
-          labels:
-            - public-linked
-          comment: |
-            ~"public" issue: https://gitlab.com/secml/secml/-/issues/#{ resource[:iid] }
-
-  merge_requests:
-    rules:
-      - name: SetMilestoneLabel
-        conditions:
-          ruby: |
-            milestone&.title && milestone_open? && !has_milestone_label?
-        actions:
-          comment: |
-            /label ~"#{ milestone.title }"
-            #{ unlabel_no_milestone_labels }
-      - name: RemoveNeedReviewAfterClosingMerging
-        conditions:
-          date:
-            attribute: updated_at
-            condition: older_than
-            interval_type: days
-            interval: 1
-          ruby: milestone.state == "closed" || milestone.state == "merged"
-          labels:
-            - needs review
-        limits:
-          oldest: 50
-        actions:
-          remove_labels:
-            - needs review
-      - name: RemovePriorityAfterClosing
-        conditions:
-          date:
-            attribute: updated_at
-            condition: older_than
-            interval_type: days
-            interval: 1
-          state: closed
-          labels:
-            - priority-{medium, high}
-        limits:
-          oldest: 50
-        actions:
-          remove_labels:
-            - priority-medium
-            - priority-high
-      - name: RemovePriorityAfterMerging
-        conditions:
-          date:
-            attribute: updated_at
-            condition: older_than
-            interval_type: days
-            interval: 1
-          state: merged
-          labels:
-            - priority-{medium, high}
-        limits:
-          oldest: 50
-        actions:
-          remove_labels:
-            - priority-medium
-            - priority-high
diff --git a/.gitlab/triage_extra.rb b/.gitlab/triage_extra.rb
deleted file mode 100644
index 301928cd..00000000
--- a/.gitlab/triage_extra.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-module TriageExtra
-
-  def has_version_label?
-    version_labels.any?
-  end
-
-  def milestone_open?
-    !milestone&.closed?
-  end
-
-  def has_milestone_label?
-    labels.include?(milestone&.title)
-  end
-
-  def no_milestone_labels
-    version_labels - [milestone&.title]
-  end
-
-  def unlabel_no_milestone_labels
-    no_milestone_labels.empty? ? "" : "/unlabel " + no_milestone_labels.map { |i| "~\"" + i + "\"" }.join(" ")
-  end
-
-  def labels
-    resource[:labels]
-  end
-
-  def version_labels
-    labels.grep(/^v\d+\..*$/)
-  end
-
-end
-
-Gitlab::Triage::Resource::Context.include TriageExtra
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 686efeb0..b5247ae8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+## v0.15.5 (02/05/2023)
+- [#18](https://github.com/pralab/secml/issues/18) added support for python 3.10
+- [#9](https://github.com/pralab/secml/issues/9) fixed import errors
+- [#19](https://github.com/pralab/secml/issues/19) removed gitlab old files 
+- Dropped tests for macOS due to PyTorch issues
+
 ## v0.15.4 (02/10/2022)
 - #16 Fixed bug in influence function due to deprecation of pinv2 function.
 
diff --git a/docs/source/developers/contributing.extensions.rst b/docs/source/developers/contributing.extensions.rst
index b20be515..a16217c9 100644
--- a/docs/source/developers/contributing.extensions.rst
+++ b/docs/source/developers/contributing.extensions.rst
@@ -6,8 +6,7 @@ We provide details on how to implement new library modules, extending our
 abstract interfaces.
 
 Remember to check out
-`latest version <https://gitlab.com/secml/secml/-/releases>`_ and
-`roadmap <https://secml.gitlab.io/roadmap.html>`_ before developing new code.
+`latest version <https://github.com/pralab/secml/releases>`_ before developing new code.
 
 Abstract Base Classes
 =====================
diff --git a/docs/source/developers/index.rst b/docs/source/developers/index.rst
index 1aa27a95..2568fbf0 100644
--- a/docs/source/developers/index.rst
+++ b/docs/source/developers/index.rst
@@ -31,7 +31,7 @@ Bug report
 
 Please ensure the bug has not been already reported. If you're unable to find
 an open issue addressing a specific problem, open a
-`new issue <https://gitlab.com/secml/secml/-/issues/new>`_.
+`new issue <https://github.com/pralab/secml/issues/new/choose>`_.
 
 Be sure to include a clear title and description, as much relevant information
 as possible and, if applicable, a code sample or an executable test case
@@ -41,6 +41,6 @@ Feature request
 ---------------
 
 Suggestions and feedback are always welcome. We ask to open an
-`new issue <https://gitlab.com/secml/secml/-/issues/new>`_ for this purpose.
+`new issue <https://github.com/pralab/secml/issues/new/choose>`_ for this purpose.
 Of course, you are free to contribute yourself to the code. See:
 `Code Contributions <contributing.code.html>`_.
diff --git a/docs/source/roadmap.rst b/docs/source/roadmap.rst
index 50d6590e..6d575169 100644
--- a/docs/source/roadmap.rst
+++ b/docs/source/roadmap.rst
@@ -3,4 +3,4 @@ ROADMAP
 
 **SecML is still in alpha stage and the roadmap is subject to change at any time.**
 
-For the most up-to-date roadmap see: https://gitlab.com/secml/secml/-/milestones
+
diff --git a/setup.py b/setup.py
index ed7dce75..92688f6b 100644
--- a/setup.py
+++ b/setup.py
@@ -146,6 +146,7 @@ def install_deps():
 Programming Language :: Python :: 3.7
 Programming Language :: Python :: 3.8
 Programming Language :: Python :: 3.9
+Programming Language :: Python :: 3.10
 Programming Language :: Python :: Implementation :: PyPy
 Topic :: Software Development
 Topic :: Scientific/Engineering
@@ -164,19 +165,19 @@ def install_deps():
     license='Apache License 2.0',
     classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
     platforms=["Linux", "Mac OS-X", "Unix", "Windows"],
-    url='https://secml.gitlab.io',
+    url='https://secml.readthedocs.io',
     download_url="https://pypi.python.org/pypi/secml#files",
     project_urls={
-        "Bug Tracker": "https://gitlab.com/secml/secml/-/issues",
-        "Source Code": "https://gitlab.com/secml/secml",
+        "Bug Tracker": "https://github.com/pralab/secml/issues",
+        "Source Code": "https://github.com/pralab/secml",
     },
-    maintainer='Marco Melis',
-    maintainer_email='marco.melis@unica.it',
+    maintainer='Maura Pintor, Luca Demetrio',
+    maintainer_email='maura.pintor@unica.it, luca.demetrio@unige.it',
     packages=find_packages('src', exclude=[
         "*.tests", "*.tests.*", "tests.*", "tests"]),
     package_dir={'': 'src'},
     include_package_data=True,
-    python_requires='>=3.5, <3.10',
+    python_requires='>=3.5, <3.11',
     install_requires=REQ_PKGS,
     extras_require={
         'pytorch': ["torch>=1.4,!=1.5.*", "torchvision>=0.5,!=0.6.*"],


Test patch:
diff --git a/.github/workflows/run_test_main.yml b/.github/workflows/run_test_main.yml
index bcd31dde..e31f9fcb 100644
--- a/.github/workflows/run_test_main.yml
+++ b/.github/workflows/run_test_main.yml
@@ -13,8 +13,8 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python-version: [3.6, 3.7, 3.8, 3.9]
-        os: [ubuntu-latest, macos-latest]
+        python-version: ['3.7', '3.8', '3.9', '3.10']
+        os: [ubuntu-latest]
         extras: [noextras, pytorch, foolbox]
 
 
diff --git a/.github/workflows/run_test_on_demand.yml b/.github/workflows/run_test_on_demand.yml
index ea7f4e0c..453c88d7 100644
--- a/.github/workflows/run_test_on_demand.yml
+++ b/.github/workflows/run_test_on_demand.yml
@@ -13,8 +13,8 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python-version: [3.6, 3.7, 3.8]
-        os: [ubuntu-latest, macos-latest]
+        python-version: ['3.7', '3.8', '3.9', '3.10']
+        os: [ubuntu-latest]
         extras: [noextras, pytorch, foolbox]
 
     steps:
diff --git a/src/secml/array/tests/test_c_array_init.py b/src/secml/array/tests/test_c_array_init.py
index 82f10889..6b8e3f85 100644
--- a/src/secml/array/tests/test_c_array_init.py
+++ b/src/secml/array/tests/test_c_array_init.py
@@ -75,9 +75,9 @@ def check_init_builtin(totest_elem):
                 action='ignore',
                 message="Creating an ndarray from ragged",
                 category=np.VisibleDeprecationWarning)
-            with self.assertRaises(TypeError):
+            with self.assertRaises((TypeError, ValueError,)):
                 CArray([[2, 3], [22]])
-            with self.assertRaises(TypeError):
+            with self.assertRaises((TypeError, ValueError,)):
                 CArray([[[2, 3], [22]], [[4, 5], [44, 55]]])
 
     def test_init_array(self):
diff --git a/src/secml/ml/features/normalization/tests/test_c_normalizer_tfidf.py b/src/secml/ml/features/normalization/tests/test_c_normalizer_tfidf.py
index 6e269b77..807c236f 100755
--- a/src/secml/ml/features/normalization/tests/test_c_normalizer_tfidf.py
+++ b/src/secml/ml/features/normalization/tests/test_c_normalizer_tfidf.py
@@ -10,7 +10,7 @@
 class TestCNormalizerTFIDF(CPreProcessTestCases):
     """Unittest for TestCNormalizerTFIDF."""
 
-    norm_type_lst = [None, 'l2', 'l1', 'max']
+    norm_type_lst = [None, 'l2', 'l1']
 
     def test_norm_tfidf(self):
         """Test for TestCNormalizerTFIDF."""
@@ -103,7 +103,7 @@ def _get_transform_component(x, y):
 
             norm = CNormalizerTFIDF(norm=norm_type).fit(array)
 
-            if (norm_type == 'l1') or (norm_type == 'max'):
+            if norm_type == 'l1':
                 # if the norm is one we are computing a sub-gradient
                 decimal = 1
             else: