Skip to content

Commit 8c13eea

Browse files
committed
Specify individual unic dependencies
1 parent f2098eb commit 8c13eea

File tree

5 files changed

+31
-192
lines changed

5 files changed

+31
-192
lines changed

Cargo.lock

Lines changed: 8 additions & 174 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

parser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ log="0.4.1"
1717
num-bigint = "0.2"
1818
num-traits = "0.2"
1919
unic-emoji-char = "0.9"
20-
unic-ucd-ident = "0.9"
20+
unic-ucd-ident = "0.9"

vm/Cargo.toml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ hex = "0.4.0"
5353
hexf-parse = "0.1.0"
5454
indexmap = "1.0.2"
5555
crc = "^1.0.0"
56-
unicode_names2 = "0.3"
57-
# TODO: use unic for this; needed for title case:
58-
# https://github.com/RustPython/RustPython/pull/832#discussion_r275428939
59-
unicode-casing = "0.1"
60-
unic = "0.9"
61-
unic-common = "0.9"
6256
maplit = "1.0"
6357
bitflags = "1.2.1"
6458
libc = "0.2"
@@ -75,6 +69,19 @@ smallbox = "0.8"
7569
bstr = "0.2.12"
7670
crossbeam-utils = "0.7"
7771

72+
## unicode stuff
73+
unicode_names2 = "0.4"
74+
# TODO: use unic for this; needed for title case:
75+
# https://github.com/RustPython/RustPython/pull/832#discussion_r275428939
76+
unicode-casing = "0.1"
77+
# update version all at the same time
78+
unic-bidi = "0.9"
79+
unic-char-property = "0.9"
80+
unic-normal = "0.9"
81+
unic-ucd-category = "0.9"
82+
unic-ucd-age = "0.9"
83+
unic-ucd-ident = "0.9"
84+
7885
flame = { version = "0.2", optional = true }
7986
flamer = { version = "0.3", optional = true }
8087

vm/src/obj/objstr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use std::string::ToString;
77

88
use crossbeam_utils::atomic::AtomicCell;
99
use num_traits::ToPrimitive;
10-
use unic::ucd::category::GeneralCategory;
11-
use unic::ucd::ident::{is_xid_continue, is_xid_start};
10+
use unic_ucd_category::GeneralCategory;
11+
use unic_ucd_ident::{is_xid_continue, is_xid_start};
1212
use unicode_casing::CharExt;
1313

1414
use super::objbytes::{PyBytes, PyBytesRef};

vm/src/stdlib/unicodedata.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ use crate::pyobject::{PyClassImpl, PyObject, PyObjectRef, PyResult, PyValue};
99
use crate::vm::VirtualMachine;
1010

1111
use itertools::Itertools;
12-
use unic::bidi::BidiClass;
13-
use unic::char::property::EnumeratedCharProperty;
14-
use unic::normal::StrNormalForm;
15-
use unic::ucd::category::GeneralCategory;
16-
use unic::ucd::{Age, Name};
17-
use unic_common::version::UnicodeVersion;
12+
use unic_bidi::BidiClass;
13+
use unic_char_property::EnumeratedCharProperty;
14+
use unic_normal::StrNormalForm;
15+
use unic_ucd_age::{Age, UnicodeVersion, UNICODE_VERSION};
16+
use unic_ucd_category::GeneralCategory;
1817

1918
pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
2019
let ctx = &vm.ctx;
@@ -71,7 +70,7 @@ impl Default for PyUCD {
7170
#[inline(always)]
7271
fn default() -> Self {
7372
PyUCD {
74-
unic_version: unic::UNICODE_VERSION,
73+
unic_version: UNICODE_VERSION,
7574
}
7675
}
7776
}
@@ -105,7 +104,6 @@ impl PyUCD {
105104

106105
#[pymethod]
107106
fn lookup(&self, name: PyStringRef, vm: &VirtualMachine) -> PyResult<String> {
108-
// TODO: we might want to use unic_ucd instead of unicode_names2 for this too, if possible:
109107
if let Some(character) = unicode_names2::character(name.as_str()) {
110108
if self.check_age(character) {
111109
return Ok(character.to_string());
@@ -125,7 +123,7 @@ impl PyUCD {
125123

126124
if let Some(c) = c {
127125
if self.check_age(c) {
128-
if let Some(name) = Name::of(c) {
126+
if let Some(name) = unicode_names2::name(c) {
129127
return Ok(vm.new_str(name.to_string()));
130128
}
131129
}

0 commit comments

Comments
 (0)